It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming Visual Basic Forum

VB.NET DataAdapter ? ? ?

Moderator: dafunkymunky

VB.NET DataAdapter ? ? ?

Postby merianos on Tue Oct 07, 2008 7:00 am

Hello all . . .

I try to create a form that managing the access level of user managment system.

The model I use is the following :


I create a connection to database
I create a DataAdapter to transfer the data from the database
I create a Dataset to hold my data
My form consists of the following :

A ListBox that list all the access level names
Three text boxes:
The first for the record ID
The second for the access level name
And the third for the discription of the access level
Five check boxes:
One for writing rights
One for the deleting rights
One for the Updating rights
One for Printing rights
And one for Special area access rights

So what i do is the following :

I create a connection string
I create a new connection to my database server
I create the DataAdapter
I initializing the DataAdapter command such as SelectCommand, DeleteCommand, e.t.c..
I fill my DataSet with the data DataAdapter get from DataBase
I binding my controls to DataSet
I setting the DataSource property of the ListBox to my DataSet
I setting the DisplayMember to the ACCL_NAME column of the DataTable inside the DataSet
I setting the ValueMember to ACCL_ID column of the DataTable inside the DataSet

Until this time all are fine ! ! !

The question is :

When i try to add a new row to dataset by using the following code i have a problem :

Dim newRow As DataRow = Dataset.Tables("TableName").NewRow

newRow("COLUMN_NAME") = Binded Control Value

DataSet.Tables("TableName").Rows.Add(newRow)

The problem is that when i try to add a new row by this way then i get two rows of data in my ListBox

Then if i try to add another then i have bigger scale of this problem ! ! !

What can i do ? ? ?

Many many thanks ! ! ! !
merianos
 
Posts: 3
Joined: Mon Aug 11, 2008 8:29 am
Location: Greece

Return to Visual Basic Forum

Who is online

Users browsing this forum: No registered users and 0 guests