Re: DataTable.New() and Rows.Add() not working right
From: Cor Ligthert (notfirstname_at_planet.nl)
Date: 06/01/04
- Next message: Neil: "Paging in DataGrid"
- Previous message: Brad Bennett: "OracleClient stored procedure parameter - can it handle 8 bit VarChars?"
- In reply to: Joe: "Re: DataTable.New() and Rows.Add() not working right"
- Next in thread: Cor Ligthert: "Re: DataTable.New() and Rows.Add() not working right"
- Reply: Cor Ligthert: "Re: DataTable.New() and Rows.Add() not working right"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Jun 2004 20:06:22 +0200
Hi Joe,
Why that ItemArray and not the Item, when I understand what you want is it
to find the proper column by the proper item you read with the datareader.
while (sqlReader.Read() )
{
DataRow dr = dtProducts.NewRow();
dr.Item["Col1"] = sqlReader.GetString(0);
\\ set more Items
dtProducts.Rows.Add(dr);
}
ds.WriteXml(@"X:\temp\Test.xml");
I hope this helps?
Cor
- Next message: Neil: "Paging in DataGrid"
- Previous message: Brad Bennett: "OracleClient stored procedure parameter - can it handle 8 bit VarChars?"
- In reply to: Joe: "Re: DataTable.New() and Rows.Add() not working right"
- Next in thread: Cor Ligthert: "Re: DataTable.New() and Rows.Add() not working right"
- Reply: Cor Ligthert: "Re: DataTable.New() and Rows.Add() not working right"
- Messages sorted by: [ date ] [ thread ]