Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Reading and writing DataSets

Reading and writing DataSets

Scheduled Pinned Locked Moved C#
databasehelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MAW30
    wrote on last edited by
    #1

    I loaded up a DataSet from an SQL table and was able to read it within the class in which I loaded the ds. However when I try to call the data from another class there is no data in the ds. Please help, Michael

    T 1 Reply Last reply
    0
    • M MAW30

      I loaded up a DataSet from an SQL table and was able to read it within the class in which I loaded the ds. However when I try to call the data from another class there is no data in the ds. Please help, Michael

      T Offline
      T Offline
      T EDY
      wrote on last edited by
      #2

      Hi, Please Please Give Us Your Code So We Can Help Solve U'r Problems :confused:

      Regards, Tomi

      L 1 Reply Last reply
      0
      • T T EDY

        Hi, Please Please Give Us Your Code So We Can Help Solve U'r Problems :confused:

        Regards, Tomi

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        yeah , please provide us with your code section

        I know nothing , I know nothing

        M 2 Replies Last reply
        0
        • L Lost User

          yeah , please provide us with your code section

          I know nothing , I know nothing

          M Offline
          M Offline
          MAW30
          wrote on last edited by
          #4

          I have 2 pieces of code one for datasets and the other a class in which I have a similar problem, I did not include all of the code but the general idea is there. I will place the second in a different thread. Note that some of the syntax comes from a program called OleDBProNet for loading data from a database though this should not matter see where I can read data in "***". Class1 { DataSet_I dsI = new DataSet_I(); DataSet_I.BSecDataDataTable BSD = new DataSet_I.BSecDataDataTable(); public void buttonFillDataTables_Click(object sender, EventArgs e) { if (checkBoxOleDBProNet.Checked == true) { if (checkBoxFilldsIDataTables.Checked == true) FilldsI_DataTablesOleDBProNet(); string strGroup = BSD[200].strGroup; ******* Data does not show here line above***** } } } Class2 { DataSet_I dsI = new DataSet_I(); DataSet_I.BSecDataDataTable BSD = new DataSet_I.BSecDataDataTable(); FilldsI_DataTablesOleDBProNet(); { ShowRowset(); string strGroup = BSD[200].strGroup; ******* Data shows here ***** } public void ShowRowset() { Rowset.MoveFirst(); while (!Rowset.IsEOF) { BSD.NewBSecDataRow(); BSD.Rows.Add(nUseRecNumID); if (Rowset.GetData(1) != null) BSD[nUseRecNumID].nRecNumID = (Int32)Rowset.GetData(1); Rowset.MoveNext(); } } } }

          1 Reply Last reply
          0
          • L Lost User

            yeah , please provide us with your code section

            I know nothing , I know nothing

            M Offline
            M Offline
            MAW30
            wrote on last edited by
            #5

            public class NameInfoCS { public int historyHandle = -1; public int nRecNumID = 0; public string Name = ""; public int item = 0; } public class FillNamesInfoArrayCS { NameInfoCS[] NameInfoArray public void FillArray() { NameInfoArray = new NameInfoCS[Names.Length]; for (int idx = 0; idx < Names.Length; ++idx) { NameInfoArray[idx] = new NameInfoCS(); NameInfoArray[idx].Name = Names[idx]; NameInfoArray[idx].nRecNumID = idx + 1000; } } } private Class1 { private NameInfoCS[] NameInfoArray = new NameInfoCS[100]; ******* if I load data from FillNamesInfoArrayCS here there is no problem, but if I load FillNamesInfoArrayCS from outside of this class and then call this class the class has no data in it. “info.” Below shows as null, “NameInfoCS info in NameInfoArray” error message says I must use new **************** public void DATAMultipleHistory() { if (program.IsEntitled != 0) { program.ReleaseAllDATA(); foreach (NameInfoCS info in NameInfoArray) { info.historyHandle = program.get_RequestHistory(info.Name, info.strDATATP, IProgram.DATAType.btDATA, info.nNumberOfDATA); } } } }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups