Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 03-02-2009
Member
 
Join Date: Jan 2009
Posts: 38
To read data from dataset in VB

Hi,
I have this code but I don't know where I have made mistake?
I have 2 tables X & Y in dataset.
Now i would like to loop through records of tableA (in the dataset) and read the
values.

Code:
for (long i = 0; i <= oDataSetMessages.Tables["tableA"].Rows.Count; i++)
{
long lngPrimaryKeyId =
Convert.ToInt64(oDataSetMessages.Tables["tableA"].Columns["PrimaryKeyId"]);
Response.Write (lngPrimaryKeyId);
}
Reply With Quote
  #2  
Old 03-02-2009
Member
 
Join Date: May 2008
Posts: 63
Re: To read data from dataset in VB

You can also try this:

Code:
nYearValue = (System.Int16) myTable.Rows[nLoop]["nYear"];
Reply With Quote
  #3  
Old 03-02-2009
Member
 
Join Date: Jun 2008
Posts: 144
Re: To read data from dataset in VB

You can also try this:

Code:
use this function to get all the data in ur data table

public void PrintTable(DataTable myTable)
{
foreach(DataRow myRow in myTable.Rows)
{
foreach(DataColumn myColumn in myTable.Columns){
Response.Write(myRow[myColumn]);
}
}
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "To read data from dataset in VB"
Thread Thread Starter Forum Replies Last Post
how to read data from file using c++ program? Juaquine Software Development 5 27-02-2010 06:02 PM
ISAPNP Read Data Port Error: Help Joyjeet Windows Software 3 26-11-2009 09:28 AM
How to read XML data generated by PHP in FLash Solaris Software Development 3 15-09-2009 07:57 PM
Unable to read Data disk through DVD Drive Neil'o Hardware Peripherals 3 31-03-2009 11:22 AM
USB pen drive - can't read the data Snehasis Portable Devices 1 22-08-2008 05:25 PM


All times are GMT +5.5. The time now is 12:25 AM.