Hi Hovik!
U can use one DataAdapter for updating multiple tables or use seperate DataAdapters for each of the tables...Now, as u said u wanted to display records from more than one table...For that u can use a single DataAdapter like this
strQuery="Select * from customers; Select * from Orders; Select * from Products";
OLEDBDataAdapter objDA = new OLEDBDataAdapter(strQuery,Conn);
objDA.Fill(objDS);
This will make a dataset and create 3 tables in it which u can then scan thru...For updating records in multiple tables, u can use different Command objects and set the "SelectCommand" property of DataAdapter to these command objects before u say objCommand.ExecuteNonQuery()...
Hope this help....
cheers,
debsoft
Quote:
quote:Originally posted by melvik
Dear Partha:
Im thankful for ur reply. First I m thankful to share ur experience!!
Yes u r right, having DataAdapter for each table will make my code clear & updatable But in the cases witch I just want to show the Data I guess it'll do the best! so could u please give me am example of setting 2/3 Table to a DataAdapter?!?!
Always:),
Hovik Melkomian.
|