add an additional column to your DataTable, and use that as the DataKeyField, for exampleDataTable1.Columns.Add("MyNewKey", typeof(string), "keyColumn1 + '#' + keyColumn2");.. DataGrid1.DataKeyField = "MyNewKey";when you are retrieving it, just split the string into two parts
DataGrid1.DataKeyField = "MyNewKey";when you are retrieving it, just split the string into two parts
s2=((TextBox)e.Item.Cells[4].Controls[5]).Text;
如果是SQLServer,将ID一道select出来,用作主键
如果是oracle,将ROWID一道select出来,用作主键
效果都不错,而且简单
AspNetPager 免费分页控件4.2版发布,同时发布最新源代码,欢迎下载:http://www.webdiyer.com
select key1+key2 as mainkey,key,key2,key3,....from [mytable]
...
update [mytable] set .... where mainkey=key1+key2