我想为网格视图中的用户提供临时删除,编辑和更新其他视图记录 [英] I like to give provisional for users in grid view to delete ,edit and update others only view records
问题描述
我想为网格视图中的用户提供临时删除,编辑和更新其他人的查看记录。
我的代码
if(Convert.ToString(Session [name])==ACCOUNTANT)
{
con.Open();
SqlCommand cmd = new SqlCommand(sp_trainingdistwise,con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue(@ distid,Convert.ToInt32(distid));
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gvtraining.DataSource = ds;
gvtraining.DataBind();
gvtraining.Columns [0] .Visible = false;
con.Close();
}
我收到错误
Hi,
I like to give provisional for users in grid view to delete ,edit and update others only view records.
my code
if (Convert.ToString(Session["name"]) == "ACCOUNTANT")
{
con.Open();
SqlCommand cmd = new SqlCommand("sp_trainingdistwise", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.AddWithValue("@distid", Convert.ToInt32(distid));
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
gvtraining.DataSource = ds;
gvtraining.DataBind();
gvtraining.Columns[0].Visible = false;
con.Close();
}
I am getting error
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
推荐答案
这篇关于我想为网格视图中的用户提供临时删除,编辑和更新其他视图记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!