is the order of parameters addition to a command for update command realy required?
-
i am using an oledbcommand object to perform both insert and update based on the command text supplied and i am adding the parameters for update also in the order of insert. So incase of update though, its not giving any error/exception but database is not getting updated. Can any body pls tell me how to resolve this or any other way to implement both the functionalities using single method. Thanks in advance.
-
i am using an oledbcommand object to perform both insert and update based on the command text supplied and i am adding the parameters for update also in the order of insert. So incase of update though, its not giving any error/exception but database is not getting updated. Can any body pls tell me how to resolve this or any other way to implement both the functionalities using single method. Thanks in advance.
You need to specify either the parameters by name ( in any order ), or pass them in the order that a stored proc you're calling requires them ( although I suspect you're using the nasty 'dynamic SQL in the presentation layer' stuff here )
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You need to specify either the parameters by name ( in any order ), or pass them in the order that a stored proc you're calling requires them ( although I suspect you're using the nasty 'dynamic SQL in the presentation layer' stuff here )
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You need to specify either the parameters by name ( in any order ), or pass them in the order that a stored proc you're calling requires them ( although I suspect you're using the nasty 'dynamic SQL in the presentation layer' stuff here )
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
OleDb doesn't support named parameters. You have to specifiy them in the exact order they appear in the SQL statement. Well, you can give them names all you want, they won't do anything... Yet another reason why I never use Access anymore.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
OleDb doesn't support named parameters. You have to specifiy them in the exact order they appear in the SQL statement. Well, you can give them names all you want, they won't do anything... Yet another reason why I never use Access anymore.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007I've found that naming them allows the use of a parameter value multiple times in the statement. And is it an OleDb thing or a Jet Engine thing?
-
I've found that naming them allows the use of a parameter value multiple times in the statement. And is it an OleDb thing or a Jet Engine thing?
I never bothered to figure that one out. I'm guessing that since you can't do it in VA code in Access either that the "problem" would be tied to Jet, but I could be wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007