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.
问问题
252 次
4 回答
1
你不能那样做。最好的解决方法是不使用SqlDataSource
和从数据库获取数据,将其与现有数据合并并将其绑定到网格。
于 2013-07-17T10:33:52.577 回答
1
那是在做正确的事;它肯定会覆盖以前的数据。在这种情况下,您需要创建一个数据集并将新获取的表数据附加到数据集中的现有表中.. :)
于 2013-07-17T10:35:22.383 回答
1
创建具有多个数据数据的视图,示例代码如下
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
欲了解更多信息,请通过
http://support.microsoft.com/default.aspx?scid=kb;EN-US;325682
于 2013-07-17T10:50:41.370 回答
1
于 2013-07-17T10:41:11.540 回答