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
What is the difference between runtime version and version?
What is the request flow used for asp.net mvc framework? : asp.net mvc
Define static constructor?
What are session objects?
Explain the reason why the javascript validation not run on the asp.net button but run successfully on the html button?
What are client activated objects?
Mention the namespace that is used to include .net data provider for sql server in .net code?
What asp.net control can embed xaml into asp.net pages?
What are the 3 types of web?
What is the exact purpose of http handlers?
Which of the following .NET framework supports Web API?
How will you do Redo and Undo in a TextControl?
Describe briefly what is the role of IIS on an ASP.NET application? What does it for the same application?
Can anyone please tell me that the question posted on this website are Sufficient for the interview with 2+ year experience in .net
Explain login control and form authentication.