help with using parameters

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top