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
Can you explain one critical mapping? Performance issue which one is better?
What is use of Master Page in ASP.NET web pages?
What is cross page posting in asp net?
Which is better session or viewstate?
What are the uses of reflection?
How can you debug your.net application?
Is it possible for me to change my aspx file extension to some other name?
Can you clarified A Web service can only be written in .NET or not?
Explain how to prepare culture-specific formatting in .net.
What is the difference between mechine.config and web.config?
Differentiate between Server.Transfer and Response.Redirect with functionality? Why we can choose one over the other?
What is the use of view state?
What is xaml? Are xaml file compiled or built on runtime?
What are client activated objects?
What does asp.net stand for?