R
RS
I have below code and i get the following error when i run it...
Procedure 'StoredProcedure1' expects parameter '@ID', which was not
supplied.
Am i setting parameters wrong?
Thank you all very much!!
OleDbDataAdapter daSqlDb = new OleDbDataAdapter("select * from dude",
m_conSqlDb);
OleDbCommand cmdSQL = new OleDbCommand("StoredProcedure1",m_conSqlDb);
cmdSQL.Parameters.Add( "@ID",OleDbType.VarChar,10,"ID");
cmdSQL.Parameters.Add("@Name",OleDbType.VarChar,10,"Name");
cmdSQL.Parameters.Add("@Size",OleDbType.VarChar,10,"Size");
daSqlDb.UpdateCommand = cmdSQL;
daSqlDb.InsertCommand = cmdSQL;
// daSqlDb.DeleteCommand = cmdSQL;
try
{
daSqlDb.Update(dsOleTextDb, "dude");
}
catch(Exception e)
{
Console.Write(e.Message);
}
Procedure 'StoredProcedure1' expects parameter '@ID', which was not
supplied.
Am i setting parameters wrong?
Thank you all very much!!
OleDbDataAdapter daSqlDb = new OleDbDataAdapter("select * from dude",
m_conSqlDb);
OleDbCommand cmdSQL = new OleDbCommand("StoredProcedure1",m_conSqlDb);
cmdSQL.Parameters.Add( "@ID",OleDbType.VarChar,10,"ID");
cmdSQL.Parameters.Add("@Name",OleDbType.VarChar,10,"Name");
cmdSQL.Parameters.Add("@Size",OleDbType.VarChar,10,"Size");
daSqlDb.UpdateCommand = cmdSQL;
daSqlDb.InsertCommand = cmdSQL;
// daSqlDb.DeleteCommand = cmdSQL;
try
{
daSqlDb.Update(dsOleTextDb, "dude");
}
catch(Exception e)
{
Console.Write(e.Message);
}