我想为网格视图中的用户提供临时删除,编辑和更新其他视图记录 [英] I like to give provisional for users in grid view to delete ,edit and update others only view records

查看:76
本文介绍了我想为网格视图中的用户提供临时删除,编辑和更新其他视图记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述







我想为网格视图中的用户提供临时删除,编辑和更新其他人的查看记录。

我的代码



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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆