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