Results 1 to 3 of 3

Thread: DataSet and DataTable problem

  1. #1
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default DataSet and DataTable problem

    I've got this bit of code (below) that I have inherited in an ASP.NET project. Apparently, I can no longer use the line in red as I get this error. Can anyone rewrite that to current standards? All help is appreciated.

    The lines in blue will probably have the same problem.
    Quote Originally Posted by Code Error
    'System.Data.DataSet.Tables.get': cannot explicitly call operator or accessor
    Code:
    public ArrayList GetAlItems()
            {
                ArrayList objArray = new ArrayList();
                DataSet objDataSet = FillControls.FillDataSet("ALL_ITEMS", ConnString);
                int iDataSet = objDataSet.get_Tables().get_Item(0).get_Rows().get_Count() - 1;
                if (iDataSet != -1)
                {
                    do
                    {
                        try
                        {
                            ListItem objListItem = new ListItem();
                            objListItem.Text = objDataSet.get_Tables().get_Item(0).get_Rows().get_Item(iDataSet).get_Item(1).ToString();
                            objListItem.Value = objDataSet.get_Tables().get_Item(0).get_Rows().get_Item(iDataSet).get_Item(2).ToString();
                            objArray.Add(objListItem);
                        }
                        catch (Exception e)
                        {
                            string message = e.Message;
                        }
                        iDataSet--;
                    }
                    while (-1 < iDataSet);
                }
                return objArray;
            }
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  2. #2
    Active Member
    Join Date
    2006-08
    Location
    Brisbane : GMT+10
    Posts
    87
    Login to Give a bone
    0

    Default Re: DataSet and DataTable problem

    I haven't tested this, but how about something like ..
    int iDataSet = objDataSet.Tables.Item(0).Rows.Count - 1;

    or should that be Tables.Item[0]. ...

    /// kdub

  3. #3
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,096
    Login to Give a bone
    0

    Default Re: DataSet and DataTable problem

    I'll check. Thanks for the help.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

Similar Threads

  1. Replies: 3
    Last Post: 2012-12-10, 01:51 PM
  2. It's not an hours problem - it's a scheduling problem.
    By Paul Munford in forum CAD Management - General
    Replies: 4
    Last Post: 2012-10-02, 02:29 PM
  3. DataTable AppendRow Fail
    By damitch725808 in forum Dot Net API
    Replies: 3
    Last Post: 2012-01-29, 07:23 PM
  4. Zoom problem + dimension & leader problem
    By Mamma Jamma in forum AutoCAD General
    Replies: 2
    Last Post: 2009-06-16, 07:21 PM
  5. Problem and desperation : Level height problem !!
    By Richard McCarthy in forum Revit Architecture - General
    Replies: 7
    Last Post: 2004-09-10, 03:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •