ok what i am trying to do is i have two textboxs which have figues in them and need the 3rd textbox to display the figure the code i am using doesnt seem to be doing anything could anyone spot it and tell me why it is not working for me

my code is

con.Open()
        cmd.Connection = con

        cmd.CommandText = "  Val(TQTY.Text) * Val(TUP.Text)"
        cmd.ExecuteNonQuery()
        cmd.Dispose()

Please try to explain this a little clearer.

i have two textboxs which have figues in them and need the 3rd textbox to display the figure

I have no idea what you want to display in the third textbox. I also have no idea why you are using a SQL query. An example of a clearer explanation would be:

I have two text boxes, TQTY and TUP. I want to multiply the numbers in these two text boxes and display the results in a third textbox, TCOST.

In which case I would reply:

First you have to determine that TQTY and TUP both contain numeric values. A simple way to do this is with the IsNumeric function. After that you can multiply them and display the result as follows:

TCOST.Text = Convert.ToSingle(TQTY.Text) * Convert.ToSingle(TUP.text)

Thank you this has been resolved

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.