August 18th, 2011, 02:36 PM
GridView button with condition
I have a gridview with 3 columns Name,Surname,Change(ButtonField column) which is populated from an SqlDataReader with the following code
SqlCommand sqlCommand = new SqlCommand("select * from Empl where userId ='" + userid + "'", sqlConnection);
SqlDataReader reader = sqlCommand.ExecuteReader();
GridView1.DataSource = reader;
In my database there are 4 columns UserId,Name,Surname,Change(bit). How can i show the button change only when Change(bit) column is true inside the database?
August 18th, 2011, 04:12 PM
Re: GridView button with condition
I have never done it... but I did find an msdn article describing a way to do this if that helps...
Last edited by fcronin; August 19th, 2011 at 11:38 AM.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!