Hi!
in the book
VB.NET of M.Reynolds, R.Blair, J.Crossland, T.Willis there's probably a "bug" about how to set parameters in a OleDbCommand.CommandText property.
vb doesn't care about the parameter name but just about the sequence of the paramenter array. the sample code works fine, but it's a lucky case.
Book's code:
---------------------------------------------------------
myCommand.CommandText = "INSERT INTO authors (au_id, au_lname, au_fname, contract) " & _
"VALUES(@au_id,@au_lname,@au_fname,@contract)"
myCommand.Parameters.Add("@au_id", txtAuId.Text)
myCommand.Parameters.Add("@au_lname", txtLastName.Text)
etc...
---------------------------------------------------------
But if you try to exchange parameters,
---------------------------------------------------------
myCommand.Parameters.Add("@au_lname", txtLastName.Text)
myCommand.Parameters.Add("@au_id", txtAuId.Text)
etc...
---------------------------------------------------------
the database field are filled wrong, with the exchanged fields!
I have VS.NET Pro 2003 italian Service Packed and I think that it's a
vb bug not reported in the book.
Am I wrong?
any suggestion?
Thanks you mouch!
(the book is very good I like it much) :)
bye
Alessandro Bernardi
BBros snc