DataTables with columns traversing rows

  • Thread starter Wayne M Jackson
  • Start date
W

Wayne M Jackson

I have a DataTable where the Columns are name:
Col1 = FirstName
Col2 = LastName
Col3 = MiddleInitial

What I have noticed, it is easier to use the above in the form or rows,
however what I need is for them to be columns eg:

Fname LName MI
Joe Blow M
John Doe N

I have tried various ways, but each time I either have the data going down
the table, or is steps across:

Fname Lname MI
Joe Null Null
Null Blow Null
Nill Null M

Can anyone give me a hint, or even direct me to some segment of code dealing
with this?
 
W

William Ryan

How are you populating it? With dataAdapter.Fill?

Lets say the data looks like this

FirstName LastName MiddleName
Joe Blow M
John Doe N

in the Acutal DataBase table and my QUery is

SELECT Firstname, LastName, MIddleName from myTable

and I use da.Fill(someDataSet, someTable)

then my data will look exaclty like this in the table.

Row[0], COlumn[0] will be Joe 0,1 will be Blow and 0,2 will be M
1, 0 will be John etc

Now, if you populate your data manually, and you are getting it elsewhere,
my bet is that either the column or row reference isn't being uppdate
corrected.

Can you post the code you are using to populate the DataTable? I'm pretty
sure it's an index.

I'll be up for a while.

Cheers,


Bill
 

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

Top