|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Insert PatternI'm developing a bigger application that will run under three DB (SQL Server, Oracle and Firebird).
I would like to use a helper class (like the Professional ADO.NET 2 example). My problem is 'simple'. In a insert I would like to use direct SQL and not sp (manage sps for three DBs if a time problem). In a simple insert using ADO.NET 2, how to take back a id column or other field filled by the DB? Your post is a little confusing to me, can you clarify this following '1.)'
statement please 1.) >My problem is 'simple'. In a insert I would like to use direct SQL and not 2.) In a simple insert using ADO.NET 2, how to take back a id>sp (manage sps for three DBs if a time problem). Im not sure about Oracle and Firebird, but in SQL, you can use the SELECT scope_identity() to get the last ID created. HTH Show quote "Max André Bündchen" <nospam@microsoft.com> wrote in message news:OzcmGniYGHA.1888@TK2MSFTNGP02.phx.gbl... > I'm developing a bigger application that will run under three DB (SQL > Server, Oracle and Firebird). > > I would like to use a helper class (like the Professional ADO.NET 2 > example). My problem is 'simple'. In a insert I would like to use direct > SQL and not sp (manage sps for three DBs if a time problem). In a simple > insert using ADO.NET 2, how to take back a id column or other field filled > by the DB? > Well, you got the problem.
With SQL Server it's easy deploy what I need. However, with a multi database I don't know whats the best way to accomplish the insert and return ID using direct SQL. Show quote "Max André Bündchen" <nospam@microsoft.com> escreveu na mensagem news:OzcmGniYGHA.1888@TK2MSFTNGP02.phx.gbl... > I'm developing a bigger application that will run under three DB (SQL Server, Oracle and Firebird). > > I would like to use a helper class (like the Professional ADO.NET 2 example). My problem is 'simple'. In a insert I would like to > use direct SQL and not sp (manage sps for three DBs if a time problem). In a simple insert using ADO.NET 2, how to take back a id > column or other field filled by the DB? > My point is, your post is not clear, and frankly your reply does not make me
want to help you further. Show quote "Max André Bündchen" <nospam@microsoft.com> wrote in message news:%23%23$WV%23iYGHA.4248@TK2MSFTNGP05.phx.gbl... > Well, you got the problem. > > With SQL Server it's easy deploy what I need. However, with a multi > database I don't know whats the best way to accomplish the insert and > return ID using direct SQL. > > "Max André Bündchen" <nospam@microsoft.com> escreveu na mensagem > news:OzcmGniYGHA.1888@TK2MSFTNGP02.phx.gbl... >> I'm developing a bigger application that will run under three DB (SQL >> Server, Oracle and Firebird). >> >> I would like to use a helper class (like the Professional ADO.NET 2 >> example). My problem is 'simple'. In a insert I would like to use direct >> SQL and not sp (manage sps for three DBs if a time problem). In a simple >> insert using ADO.NET 2, how to take back a id column or other field >> filled by the DB? >> > > |
|||||||||||||||||||||||