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 a global postback url?
What is route in web api?
Explain the difference between overriding and overloading?
What is the difference between cache and cookies?
How to find out what version of asp.net I am using on my machine?
What is State Management in .Net and how many ways are there to maintain a state in .Net? What is view state?
What are the security types in ASP/ASP.NET? Different Authentication modes?
What is the difference between web.config and machine.config in ASP.NET?
What does asp in asp.net stand for?
What is the difference between custom controls and user controls?
What is the difference between rest and restful?
Explain the concept of View Model in MVC?
Define static function?
What is a session government?
Error : The operation couldn’t be performed because ole db provider sqlncli10 for linked server was unable to begin a distributed transaction.00000110 oledb provider for linked server returned message the partner transaction manager has disabled its support for remote/network transactions. I can able to execute the stored procedure in sql server but when i run the web page getting error like above. I did all the configuration. what is the solution?