Results 1 to 3 of 3

Thread: To read data from dataset in VB

  1. #1
    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);
    }

  2. #2
    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"];

  3. #3
    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]);
    }
    }
    }

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,266,160.17537 seconds with 17 queries