none
VB.net Mysql Search Problem RRS feed

  • Question

  • To Whom It May Concern,

    I have a VB.net application that is connected to mysql server database.

    I have columns in that database that are FLOAT and I have triggers that auto-calculate and all is well.

    The auto-calculate is inserting the write digits in the columns and are being decimals such as for example 2.4679.

    Now the problem is when I search from vb.net for a specific row in mysql and showing them in Datagridview the values of some are not the same in the database.

    for example

    i search for a row that has ID = 1

    It has 3 rows that are price = 7, price + fee = 2 , final cost = 3

    Whereas in the database they are 7.52    2.4679 and 3.61

    and more to that when I enter dataset.xsd and click on configure query ---> query bulider ---> preview data ---> the decimals are showing exactly the same as in the database...

    Here are some pics:

    This one is from Query Builder

    This one is from Query Builder

    This ons is when i debug:

    THis is when i open the program

    • Moved by 宝宝徐 Monday, September 25, 2017 2:39 AM
    Friday, September 22, 2017 3:28 PM

All replies

  • Hi Tony,

    Welcome to MSDN forum.

    As there is particular forum for VB, I will move this thread there for you to get a quick and professional answer.

    Thanks for your understanding.

     

    Best regards,

    Fletcher


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Monday, September 25, 2017 2:35 AM
    Monday, September 25, 2017 2:35 AM
  • Hi Tony,

    According to your description, you said that the value from the database is automatically routed. How do you get data from MySQL database, because I try to search data from MySQL, I can get the same data as MySQL database

    Dim ConnectionString As String = "Server=127.0.0.1;Database=test;Uid=root;Pwd=;"
    Dim sql As String = "select * from test8 where ID=1"
    Dim dt As New DataTable()
    
    Using con As New MySqlConnection(ConnectionString)
    	Using cmd As New MySqlCommand(sql, con)
    		cmd.CommandType = CommandType.Text
    		Using sda As New MySqlDataAdapter(cmd)
    			sda.Fill(dt)
    			dataGridView2.DataSource = dt
    		End Using
    	End Using
    End Using

    You can post some code here, it is helpful to us to analyze this issue.

    Thanks for your understanding.

    Best regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, September 25, 2017 5:52 AM
    Moderator