Logo 
Search:

Asp.net Answers

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds
  Question Asked By: Zobah Mizrachi   on Dec 18 In Asp.net Category.

  
Question Answered By: Calvin Banks   on Dec 18

The problem now is that SQLDataReader doesn't return a dataset ... it merelt
reads etc.

I found this
ms-help://MS.VSCC/MS.MSDNVS/cpguide/html/cpcontheadonetdatareader.htm

While a DataReader is open, you can retrieve schema information about the
current result set using the GetSchemaTable method. GetSchemaTable returns a
DataTable object  populated with rows and columns that contain the schema
information for the current result set.


[C#]


DataTable schemaTable = myReader.GetSchemaTable();

foreach (DataRow myRow in schemaTable.Rows)
{
foreach (DataColumn myCol in schemaTable.Columns)
Console.WriteLine(myCol.ColumnName + " = " + myRow[myCol]);
Console.WriteLine();
}

So try

DataTable oReadDT = oReader.GetSchemaTable();

and set your dataSource to oReadDT

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Dropdown nested in repeater Or get search suggestion and latest updates.


Tagged: