【发布时间】:2014-12-17 18:54:38
【问题描述】:
protected void grd_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["constr"].ToString());
con.Open();
string query = "delete from details where sno='"+grd.DataKeys[e.RowIndex].Value+"'";-----(getting error like Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index)
SqlCommand cmd = new SqlCommand(query,con);
cmd.ExecuteNonQuery();
filldata();
con.Close();
}
gettnig 错误,例如 Index 超出范围。必须是非负数且小于集合的大小
【问题讨论】:
-
你有什么问题?
标签: asp.net sql-server c#-4.0 webforms