#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    2
    Rep Power
    0

    Filling a Dataset ??


    Hi,

    i have some problems filling a dataset from a firebird sql embedded database...

    Code:
    public void readUser(string table)
            {
                FbConnection myCon = new FbConnection("ServerType=1;User=SYSDBA;Password=masterkey;Dialect=3;Database="D:\MyDB.fdb");
                myCon.Open();
                string sqlOrder = "SELECT * FROM " + table;
                FbDataAdapter da = new FbDataAdapter(sqlOrder, myCon);
                DataSet myDataSet = newDataSet();
                da.Fill(myDataSet);
                myCon.Close();
            }
    After this lines of code the DataSet is still empty. The property "HasRows" is still false...

    If i use an FbDataReader it works fine and i can read the whole Database. Wheres my fault ? How do i fill a DatSet ?
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    9
    Rep Power
    0
    I don't recognise this programming language, no doubt other readers will. Superficially it looks like Java or maybe php. The trouble is there is an interfacing .dll between your code and the firebird database manager that converts your code to sql queries as well as other things, and you need to address your question to people who have familiarity with it.

    In particular, following an SQL query, for each row Firebird returns a set of parameters corresponding to the fields requested, and it then repeats this operation for each row that the query returns. It is the task of the receiving code to assemble these into a table. (Actually this is standard for all databases). For example Delphi assembles these in a TDataset component, php assembles them into a hidden table which can be accessed by row reference. It looks like your language needs an instruction to load the data into a Table. As you can see each language handles the data differently, hence my advice to address this question to a forum about your language.

    Good luck.
    Geoff Marshall
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2012
    Posts
    2
    Rep Power
    0
    Hi,

    The programming language is C#.

    Thanks for your advice, this confirmed my sucpicion. Ill try to find someone who is familiar with this language an the datset.

IMN logo majestic logo threadwatch logo seochat tools logo