I had a Gridview bind sqldatasource, and I had logins that see gridview, and I created roles for these logins, from which someone does not see the entire gridview column, so how can I only make some columns.?
public void code CheckLoginAuthorty () {
using (SqlConnection Con = Connection.GetConnection()) { SqlCommand com = new SqlCommand("CheackLoginInRole", Con); com.CommandType = CommandType.StoredProcedure; com.Parameters.Add(Parameter.NewNVarChar("@Login", Session.Contents["Username"].ToString())); object O = com.ExecuteScalar(); if (O != null) { string S = O.ToString(); if (IsInRole("AR-Translator", O.ToString())) { ///////// Grideview code///////////////// } else if (IsInRole("EN-Translator", O.ToString())) { /////////Grideview code///////////////// } } } }
source share