PC Review


Reply
Thread Tools Rate Thread

Update error

 
 
RS
Guest
Posts: n/a
 
      21st May 2004
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);
}


 
Reply With Quote
 
 
 
 
Rajesh Patel
Guest
Posts: n/a
 
      21st May 2004
Which is your database?

If it is sqlserver, you need "@ID" instead of "ID" in the 3rd parameter of
cmdsql.parameters.add("@ID, oledbtype.varchar, 10, "ID") statements.

Rajesh Patel

"RS" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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);
> }
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot update, the automatic update is not in services.msc and saysit is when try to install receive this error when trying to automatic update Cornholis Windows XP Basics 2 27th Aug 2011 07:59 AM
Vista Windows Update error Code: 80070490 Windows Update encountered an unknown error Michel Speed Windows Vista General Discussion 1 24th Jan 2009 11:02 PM
windows update fails to update to new version with error code 8007 vijay Windows Vista General Discussion 3 14th Jan 2009 07:25 AM
Windows update error 80070103 - Beta 2 Vista NVIDIA Driver Update =?Utf-8?B?RGVlcGFrIFNoZW5veQ==?= Windows Vista General Discussion 4 28th Feb 2007 03:26 PM
Windows Update Error number: 0x80072EE2 - Windows Update has encountered an error and cannot display the requested page Mart Windows XP General 1 23rd Sep 2004 12:18 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:57 AM.