none
Result of Filling table with typed dataset is wrong RRS feed

Answers


  •  I think that you should validate for that in code before you pass it on to your query (i.e., make sure that the frm_floor variable is less than 10).

    | had already thought about that, but I have a lot of fields and tables to make validation in my project in this case.

    Well, here is a good news, I figure out what is happening.

    When I enter the query for the commandText thet belong to the Fill, the designer automatically created a parameter needed (as below)

    If I set the Precision to 0 instead of 1, it will work as expected. (..... interesting)

    As long this solve the problem, I will not ask more questions ;)


    Blog: http://samir-ibrahim.blogspot.com/

    • Proposed as answer by BonnieBMVP Tuesday, January 29, 2013 5:58 AM
    • Marked as answer by Samir Ibrahim Wednesday, January 30, 2013 9:53 AM
    Monday, January 28, 2013 8:13 AM

All replies

  • Samir,

    Be aware I've not tested it, but can you tell if you started fresh with this 66 one.

    Normally a Fill does Add to an existing dataset. It does not a clear in advance, that you have to do yourself.

    I'm not aware what the designer tool does in this case.

    So if you would have done this in code

    Dim ds as new DataSet

    TheDataAdapter.GetByWhatever(parameter1, parameter2)
    TheDataAdapter.GetByWhatever(parameter3,parameter4) 

    And one does not exist and one does in one row there would stay 1 row in the dataset.


    Success
    Cor

    Sunday, January 27, 2013 2:03 PM
  • Samir,

    Be aware I've not tested it, but can you tell if you started fresh with this 66 one.

    Normally a Fill does Add to an existing dataset. It does not a clear in advance, that you have to do yourself.

    I'm not aware what the designer tool does in this case.

    So if you would have done this in code

    Dim ds as new DataSet

    TheDataAdapter.GetByWhatever(parameter1, parameter2)
    TheDataAdapter.GetByWhatever(parameter3,parameter4) 

    And one does not exist and one does in one row there would stay 1 row in the dataset.


    Success
    Cor

    Hi Cor

    Actually the reason i went to the designer is I thought maybe (I coded wrong or set a thing by mistake).

    I am getting in code the same result I qm getting in the designer.

    I did more tests, if I enter 6789 or 4123 or 53 or 1234 (i am getting a row as long as the first digit is from 1 to 6)


    Blog: http://samir-ibrahim.blogspot.com/

    Sunday, January 27, 2013 5:45 PM
  • Hi Samir,

    I'm pretty sure it's because the frm_floor column in your database table is only one digit. Maybe that's a bug with the VFPOleDb driver, or maybe it's supposed to be that way. I think that you should validate for that in code before you pass it on to your query (i.e., make sure that the frm_floor variable is less than 10).


    ~~Bonnie Berent DeWitt [C# MVP]

    geek-goddess-bonnie.blogspot.com

    Sunday, January 27, 2013 5:58 PM

  •  I think that you should validate for that in code before you pass it on to your query (i.e., make sure that the frm_floor variable is less than 10).

    | had already thought about that, but I have a lot of fields and tables to make validation in my project in this case.

    Well, here is a good news, I figure out what is happening.

    When I enter the query for the commandText thet belong to the Fill, the designer automatically created a parameter needed (as below)

    If I set the Precision to 0 instead of 1, it will work as expected. (..... interesting)

    As long this solve the problem, I will not ask more questions ;)


    Blog: http://samir-ibrahim.blogspot.com/

    • Proposed as answer by BonnieBMVP Tuesday, January 29, 2013 5:58 AM
    • Marked as answer by Samir Ibrahim Wednesday, January 30, 2013 9:53 AM
    Monday, January 28, 2013 8:13 AM
  • Yes, that should do the trick. You should mark your post as the answer...

    ~~Bonnie Berent DeWitt [C# MVP]

    geek-goddess-bonnie.blogspot.com

    Tuesday, January 29, 2013 5:59 AM