0

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()
2
Contributors
2
Replies
4
Views
5 Years
Discussion Span
Last Post by Farhan_B
1

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)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.