datalist怎么取主键
dlLy.DataKeyField = "LyId";
int LyId = Convert.ToInt32(dlLy.DataKeys[0]);
LyId是主键
------解决方案--------------------dily.DataKeys[e.Item.ItemIndex].ToString()
这个可以获得主键
------解决方案--------------------dlLy.DataKeyField = "LyId";
某行的ID 就是 id=dily.DataKeys[e.Item.ItemIndex].ToString()