VB.NET - Links VB.NET with ODBCDataReader to get rowCount

Asked By silna chandra on 29-Sep-08 07:39 AM

hi

I am not able to get rowcount in vb.net using odbcdatareader ?

plz post some useful links which demonstrate the code samples for vb.net to work with odbc objects like odbcdatareader,

especially how to get the rowcount in case of odbcdatareader .

 

thks

silna

solution - Perry replied to silna chandra on 29-Sep-08 08:14 AM

This code worked for me.

DataTable dt = ds1.Tables[0];
DataRow[] foundRows;

while (a < lbCombo.Items.Count)
      {
      string Z = lbCombo.Items[W++].Text;
            {
            string strExpr = "COLUMN_DESC = '" + Z + "'";
            string strSort = "VIEWNAME DESC";
            foundRows = dt.Select(strExpr, strSort);
            string strText = null;
            int i = 0 ;
            string f = foundRows[i].ItemArray[0].
ToString();
            string g = foundRows[i].ItemArray[1].ToString();
            strText = f + "." + g;
            lbInvis.Items.Add(strText);
            lbInvis.DataBind();
            }
      a++;
      }

try this... - Vasanthakumar D replied to silna chandra on 30-Sep-08 12:57 AM

Hi,

to find the rows count, you have to loop through the datareader in any provider,.,.

for this better you go with dataset....

Post some sample ODBCDatareader - silna chandra replied to Vasanthakumar D on 30-Sep-08 02:04 AM

hi

plz post some code sample......

thanks

Silna