I am new to .Net application development. I'm working on a project using MS Access. In my application I have one Gridview with unbound data. I have one SQL Datasource which I bind to Gridview dynamically. When I bind that SQL Datasource to the Gridview the existing data is overridden. Instead of overriding I want to append the rows to the existing rows in Gridview.
4 Answers
You can't.
Gridview can have only one datasource at time. Every time you try to bind another datasource, it always overrides the existing one.
One of the best option is to use JOIN if these datasource are in same database.
Check also:
Comments
create a view with multiple data datable a sample code is below
jv = New JoinView(ds.Tables!Ord, _
"OrderID,CustomerID,EmployeeID,OrderDate,CustOrd.CompanyName Company,CustOrd.ContactName Contact,CustOrd.ContactTitle Position,EmpOrd.FirstName,EmpOrd.LastName", _
"EmployeeID<5", "OrderDate")
DataGrid1.DataMember = ""
DataGrid1.DataSource = jv
for more info go through
http://support.microsoft.com/default.aspx?scid=kb;EN-US;325682