Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

can i fire a sql query on the table of Dataset?

Tags:

c#

.net

sql

ado.net

I know this is very stupid thing to ask. But i am not as genius as you all. if i have a dataset as give below:-

adapter.fill(ds,"Login");

Now the table created in Dataset is "Login". Now can i fire a sql command over this table like

sqlcommand cmd = new sqlcommand("select * from Login");
like image 255
Sometimes Code Avatar asked Feb 19 '23 00:02

Sometimes Code


1 Answers

you can filter the data table, eg

ds.Tables["Login"].Select("ID=1 AND ID2=3"); // sample expression

more on this link

  • Filtering and Sorting in Datasets
like image 87
John Woo Avatar answered Feb 20 '23 20:02

John Woo