|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
help with using parametersI have a query which looks like this :"INSERT INTO demo (idperson,
name)SELECT idperson,name FROM ptolemy_person WHERE idperson = @original" and I have declared a parameter in this way: OleDbCommand1.Parameters.Add("@original", txtvalue.Text). the query is supposed to populate a table(demo) with records from another table(ptolemy_person) based on the id of the records which are typed in the textbox. when i run the progam i get this error: THe oledbparameter collection only accepts non-null oledbparameter type objects. not strings Can you please help thanx be_gentle learner beGentle-Learner,
Depending on the particular database and version of ADO.Net, you might need to change the parameter placeholder to this: "INSERT INTO demo (idperson, name) SELECT idperson,name FROM ptolemy_person WHERE idperson = ?" At any rate, that is the first thing I would try. Kerry Moorman Show quoteHide quote "beGentle-Learner" wrote: > I have a query which looks like this :"INSERT INTO demo (idperson, > name)SELECT idperson,name FROM ptolemy_person WHERE idperson = @original" > and I have declared a parameter in this way: > OleDbCommand1.Parameters.Add("@original", txtvalue.Text). > > the query is supposed to populate a table(demo) with records from another > table(ptolemy_person) based on the id of the records which are typed in the > textbox. > > when i run the progam i get this error: THe oledbparameter collection only > accepts non-null oledbparameter type objects. not strings > > Can you please help > thanx > be_gentle learner > >
changing the date format in vb.net
Datasets - use 1 or many? Assigning the result of a '/' division to an integer type causes rounding How to force upper case in a DataGridView column? Dealing with NULL values in Integer fields Mulples threads and impersonation Calling a batch file from vb.net with parameters Handle pointers from delphi client to a vb.net dll What's the Best Startup Scenario for Unattended Server Execution? VB.net 2005 splash screen |
|||||||||||||||||||||||