帮忙看看这段话有错吗?为什么会报错"索引超出范围。必须为非负值并小于集合大小.
我要删除表中一条记录string del="delete from CUSTMON where PKID=@pkid";
SqlConnection con=new SqlConnection(ConnectionString);
SqlCommand com=new SqlCommand(del,con);
com.Parameters.Add(new SqlParameter("@pkid",System.Data.SqlDbType.Int,4));
com.Parameters["@pkid"].Value=DataGrid1.DataKeys[(inte.Item.ItemIndex];