Felsök: Procedure ... expects parameter ... which was not supplied
Hade en del problem med att luska ut vad detta felmeddelandet berodde på.
Procedure <procedure name> expects parameter <parameter name>, which was not supplied : ADO.NET Error
Till slut hittade jag lösningen på Data Mining Developers.
Exempel av problemet
string ColumnName = null;
//error will be thrown if the variabe ColumnName is null
if(ColumnName ==null)
ColumnName=string.Empty;
SqlParameter param = new SqlParameter("@ColumnName", SqlDbType.NVarChar, 100);
param.Value = ColumnName;
cmd.Parameters.Add(param);
cmd.Execute();
//error will be thrown if the variabe ColumnName is null
if(ColumnName ==null)
ColumnName=string.Empty;
SqlParameter param = new SqlParameter("@ColumnName", SqlDbType.NVarChar, 100);
param.Value = ColumnName;
cmd.Parameters.Add(param);
cmd.Execute();
Tags