Storing data from 2 different tables in Dataset...
Reply
![]() |
|
From:
![]() MaxNick007
|
Hi Suresh
Sorry for the delay ,i am busy with my gf so u knw .........
so ur question is u don't wanna use Stored Procedure , okie fine , not a prob
try this out u will get the solution
Dim sqlconn As New SqlClient.SqlConnection() sqlconn.ConnectionString = "server=OM;database=Northwind;uid=sa;pwd=winner" Dim sqlcmd As New SqlClient.SqlCommand() Dim sqladp As New SqlClient.SqlDataAdapter() Dim ds As New DataSet()
' NOTE THIS PARTICULAR LINE FOR THE PROBS '-------------------------------------------------------------------------------------------------------------------------- sqlcmd.CommandText = "select * from orders ; select*from employees"
'------------------------------------------------------------------------------------------------------------------------- sqlcmd.CommandType = CommandType.Text sqlcmd.Connection = sqlconn sqladp.SelectCommand = sqlcmd sqladp.Fill(ds, "Solution_Core1") DataGrid1.DataSource = ds.Tables(0) DataGrid2.DataSource = ds.Tables(1) DataGrid1.databind() DataGrid2.databind()
just sperate the two queries with the kool seprator called ' ; ' , u will get 2 tables in a single data set
i think it will work out , plz let me know if u get any problem
if i have a solution , i will work out
Regards
Saurabh
Nothing is Impossible even Impossible says I M POSSIBLE
_________________________________________________________________ Daily personalized predictions. http://www.astroyogi.com/newmsn/mypage Get them in your mailbox.
|
|
View other groups in this category.
![]() |
To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.
Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.
If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.
|
|
- Re: Storing data from 2 different tables in Dataset... MaxNick007
-