S
steve
Hi,
I have a few examples and things are quite clear with using a datareader (reading data, naming column headers etc.), and populating a listview.
However: (!!!) In all of the examples we know beforehand the number of fields and therefore the data type (Int, Date, String etc) since the SELECT string is constant.
My problem is with variable strings that get constructed at runtime. Then, since i do not know beforehand what exactly is my first,second, etc. field, I CANNOT use :
myDataReader.GetString(0) or myData.GetInt32(0),etc. since io do not know the type beforehand.
Is there a way around this? I really dont mind getting them all as text so is the an CType analogous method I could use . Something like casting BEFORE reading ??
ANY help would be appreciated,
Thanx
-steve
I have a few examples and things are quite clear with using a datareader (reading data, naming column headers etc.), and populating a listview.
However: (!!!) In all of the examples we know beforehand the number of fields and therefore the data type (Int, Date, String etc) since the SELECT string is constant.
My problem is with variable strings that get constructed at runtime. Then, since i do not know beforehand what exactly is my first,second, etc. field, I CANNOT use :
myDataReader.GetString(0) or myData.GetInt32(0),etc. since io do not know the type beforehand.
Is there a way around this? I really dont mind getting them all as text so is the an CType analogous method I could use . Something like casting BEFORE reading ??
ANY help would be appreciated,
Thanx
-steve