"Matt" wrote...
Thats giving me column name that i would ask for.
What i like to achive is
While i am reading the Reader without knowing what are the column
names, i would like to go thru all the column names and compare with
some variables that i have so !
while(objRead.Read())
{
foreach loop or something // go thru all the column names
{
if any match = x
{console.writeLine}
}
}
can i do this?
Well, I guess you're after something like this...
DataTable myTable = objRead.GetSchemaTable();
while(objRead.Read())
{
foreach(DataRow myRow in myTable.Rows)
{
string colname = myRow["ColumnName"].ToString();
if (matchcondition)
{
// Console.WriteLine or whatever...
}
}
}
// Bjorn A