Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

How to extract values from a SQL statement to a C#.NET DataTable?

How to extract values from a SQL statement to a C#.NET DataTable?


I am doing fine extracting values from the SELECT statement of an SQL statement, after executing that SQL statement from C#. I get the values properly visible to my code in a DataTable and/or DataRow object.


So, is there any other way to get value aside from including them tin the SELECT statement?


Curious...

ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

I want to see how many options I have, as I write the SQL query. The query is getting created as a string, which I text in my SQL emulation tool called Synergex.

So, my question is about the SELECT statement. Is this the only way to make a column's data available as we consume the query results?

If it must exist in the SELECT, please just confirm this.

Thanks
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
so, for clarity, the link provided by @slightwv shows many ways to get data from. a query, but those are different ways to populate the SELECT statement, right? so, your answer remains correct, that it must exist in the SELECT in order to be returned in the result set. Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial