Skip to Content

My matrix cannot handle float values

My matrix handled my float columns ok when I used DBDataSource. But after I changed to DataTable (a must since i need data from 3 tables) the float values becomes rubbish in the matrix.

After ExecuteQuery I inspect the datatable and the values are correct and with correct type (System.Double).

After Matrix.LoadFromDataSource() the float columns shows rubbish tokens (like chinese).

After Matrix.FlushToDataSource() I inspect the datatable again => now all float values has values like 9007336695,79165.

What is wrong? Do I have to convert all values in the select statement to varchar to get it work?

Regards

Lars Jönson

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Nov 06, 2008 at 01:14 PM

    After tooooo many hours I have finally found the problem: it is about binding columns.

    As I wrote I started to use a DBDataSource and when creating the matrix and its columns I also do the binding with SetBound before the DBDataSource is loaded with the data.

    After switching to DataTable it's not possible to bind with Bind() when the DataTable is empty.

    Therefore I made this dirty trick: I loaded the DataTable with my select but using a where-condition that resulted in 0 rows.

    By doing this the DataTables columns are populated with the correct information and it's possible to do the binding in the matrix. But this also is the cause why the float values is represented with rubbish tokens after loading the DataTable with a correct row. If I wait with the binding process until there is data in the DataTable it will work ok.

    I consider this a bug in the matrix!

    Now I have to solve when and how to do the binding. My form is started empty in the ADD mode and must be able to work when my tables are empty. It looks like the problem with the hen and the egg, which came first?

    Any suggestions anybody?!

    Regards

    Lars Jönson

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 06, 2008 at 03:22 PM

    All folks seems as much confused as I am...

    I have to change my opinion. The problem is that the float values become strange after a new ExecuteQuery in the DataTable. But if i rebind the float columns after each ExecuteQuery it works!!!

    String and Int columns has never been a problem.

    Regards

    Lars

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Lars,

      its standard behaviour. Before each query Im unbinding it as

      omatrix.Clear()

      For q = 0 To oMatrix.Columns.Count - 1

      If oMatrix.Columns.Item(q).DataBind.DataBound Then oMatrix.Columns.Item(q).DataBind.UnBind()

      Next q

      and then bind it again. This problems occurs not everytime, but occasionaly and rebindinding the columns works for me in all cases.

  • Posted on Nov 11, 2008 at 07:27 AM

    Thank you both for your answers. I'm glad to hear that this is my main problem, that I must rebind my columns after each query.I consider this a bug in the Matrix or EditText, because it's only the float columns that have to be rebind.

    On the other hand it is sad that I have to spend 2 days trying to find out why my code is not working while the answer is "common knowledge" among experienced SDK-programmers. I'm a newbie on the SDK but have worked 20 years with system development. My experience with the SDK is that is "big" but too many things has to be done in a certain way that is undocumented and not obvious.

    My opinion about the SDK is:

    1) too old fasioned technology (COM),

    2) poor documentation, a book (in brick format!) is needed

    3) only elementary samples, more advanced samples are needed

    But the forum is a lifeline, how can we live without it????

    Don't hesitate to comment this!

    Regards

    Lars Jönson

    LittleFish, Sweden

    Add a comment
    10|10000 characters needed characters exceeded

    • Lars,

      Thanks for the comments. I will pass the comment to development team.

      You hit the point. Knowledge management is pretty citical.

      Online help is knowledge base of basic topics, it is useful for basic topic and newbie.

      However, as you mentioned the Forum (community) is a great place for networking and advanced topics etc. That is the initative and value of the forum community. Thanks.

      Kind Regards

      -Yatsea

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.