Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

how can we display records in single datagrid using two
datasets in different place?

Answer Posted / ruby

we can do it using merge method of dataset.
but for that bot the tables must have same no. of columns , same fields and their respective datatypes.

also both the data table's name must be same("Table1" of both the datasets)

Sub BindGrid()
Dim myConnection as New SqlConnection (strConn)

Dim DS1 As DataSet
Dim DS1 As DataSet
Dim MyCommand As SqlDataAdapter

MyCommand = new SqlDataAdapter("exec s_get_table1", MyConnection)
DS1 = new DataSet()
MyCommand.Fill(DS1, "Table1")

MyCommand = new SqlDataAdapter("exec s_get_table2", MyConnection)
DS2 = new DataSet()
MyCommand.Fill(DS2, "Table1")
// Then using MERGE function of dataset we can merge both the datasets like

ds1.merge(ds2)
//binding with grid

MyDataGrid.DataSource=DS1.tables(0).DefaultView
MyDataGrid.DataBind()
End Sub

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we provide the WebParts control functionality to a server control?

995


Explain Life cycle of ASP.NET page when a request is made.

1208


What are the benefits of view state?

940


What do you mean by View State and what is its role?

1083


What language does asp.net use?

987


Explain the use of dataadapter.

1073


How to improve performance of web application asp.net mvc? : Asp.Net MVC

1015


Which is better session or viewstate?

946


How can you identify that the page is post back?

989


How can you handle exceptions in asp.net?

1041


Explain page output caching?

980


Explain diff. Betn dataset and recordset?

998


What are the ways to sending the data in ASP.NET page?

1078


What is the difference between ldap and active directory?

1072


Which ASP.NET configuration options are supported in the ASP.NET implementation on the shared web hosting platform?

1108