ADO.NET output parameter
-
Hi, i would like to know how it's possible to work with a output parameter. i already worked this way for input: "insert into ... (test, test2) values(@test, @test2)" and then i add those parameters to the parameterscollection of my odbccommand object. now i want to do a simple select of one column: "select test from testtable" but how can i retrieve that value , the result of my query i mean, without working with a dataset or a reader. is it possible to also work with parameters for this? grtz & thx
-
Hi, i would like to know how it's possible to work with a output parameter. i already worked this way for input: "insert into ... (test, test2) values(@test, @test2)" and then i add those parameters to the parameterscollection of my odbccommand object. now i want to do a simple select of one column: "select test from testtable" but how can i retrieve that value , the result of my query i mean, without working with a dataset or a reader. is it possible to also work with parameters for this? grtz & thx
If your result set is one column in one row then you can use
ExecuteScalar();
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
-
If your result set is one column in one row then you can use
ExecuteScalar();
My: Blog | Photos | Next SQL Presentation WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
thx that works ;) and what if i don't have more than one value, let's say: select test, test2 from testtable how do i get the value of test and test2 ? (without reader and without filling a dataset)