Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting items from checklistbox to database

Status
Not open for further replies.

yonelay

Programmer
Jan 17, 2007
10
US
Hi,

I have a checklistbox called from a table with permissions as value and a "Save" button. I am able to display the permissionlevel as checklistbox. For example,

Read

Write

Execute

Full Control

(Save) button

I have another table which associates with userid and permissionlevel. If a user has read and write permission in the table, when that user signs in, I want Read and Write checkbox to be displayed as checked. The user may uncheck or check more permission. When he clicks "Save" button, I want everything that is checked to insert to a table and delete anything that is unchecked from the table. I am new to C# and still trying to learn this new language, so if you can be specific with your answer, it will be very grateful. Thanks.

This is my code for displaying the list.

private void Form1_Load(object sender, EventArgs e)
{

permissionDetailsTableAdapter.Fill(mydataDataSet.PermissionsType);
checkListBox1.DataSource = mydataDataSet.PermissionsType;
checkListBox1.ValueMember = "permissionID";
checkListBox1.DisplayMember = "permissionDescription";

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top