wpf - C# Dataset Dynamically Add DataColumn -


After the completion of a query, I am trying to add an additional column to the dataset and with that new column I am populating. I have one of the following database relation:

  Employees Group / Group Employees  

Empoyees for everyone Keeps the data, I will nominate the unique key of user ID.

Groups keeps all those groups which can be part of an employee, i.e. super user, administration, user; e.t.c. I will name the unique key group ID

Employee Group keeps all organizations of all organizations, which are also related to each employee (UserID | Group ID)

I want to inquire for every user what I am doing after inquiring for all the users, but I should say that which user is part of the group, which is a group of datasets by adding a new column To group a 'group' with a type of string whose user is a part of the user. Then populate a list view with all employees and their group organizations using databasing.

My code is as follows; Position 5 is the new column I'm trying to add to the dataset.

  string theQuery = "Choose from userID, firstname, lastname, employee ID, employee active"; DataSet theEmployeeSet = itsDatabase.runQuery (theQuery); DataColumn theCol = New DataColumn ("group", typef (string)); TheEmployeeSet.Tables [0] .clumns.Add (theCol); Foreign Currency (Datourve the Row in Employless Teables [0] .ro) {The Rouge Itam Array [5] = "1234"; }  

At the moment, the code will create a new column but when I do not specify any data to that column, what am I missing?

Edit
The changed database diagram was incorrect

< / Div>

You should set all values ​​once you use the motherrot.
AS:

thero.ItemArray = New Object [] {x, y, z, s, d};

I agree that it is not clear that you should use it .. .. I think Gator copies the data and you fill the element 5 of that copy <

You should:

  thero ["group"] = "1234"  

or:

  theRow [5] = "1234"  

Comments