Hep - for .NET newbie

  • Thread starter Thread starter djfd
  • Start date Start date
D

djfd

I'm trying to write a routine to check if a user is an Admin from a SQL
table.
'Admin' column of the table is defined as bit (boolean) and signifies
whether
the user is admin or not.

Once I filled my dataset, I can use it to fill my grid.
If the user is admin, I want to disable some textboxes on the form for that
user.
How do I do this ? How do I get to the value of Admin and check to see if
it's true or false.
My dataset name is dataSet11.
Tablename is 'contacts'.
Column name is 'Admin' and is defined as bit type.

Can someone show me what the code may look like in C# ?
Thanks
 
I assume you mean to look at the row currently selected in the grid
(dataGrid1?)

bool b =
(bool)(dataSet11.Tables["contacts"].Rows[dataGrid1.SelectedIndex]["Admin"]);

it's something like this
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top