mike55 Posted May 10, 2005 Posted May 10, 2005 Hi all Here is my statement: Dim credit As Decimal Dim price As Decimal Dim cncon As New SqlConnection(clsConnection.osqlStr) Dim commSQL As New SqlClient.SqlCommand cncon.Open() Try commSQL.Connection = cncon commSQL.CommandType = CommandType.Text commSQL.CommandText = "Select Credit from SMS_Credit where Org_ID = '" + organization + "'" credit = commSQL.ExecuteScalar commSQL.CommandText = Nothing If operation = 1 Then 'Deduct the price of a SMS Message. price = credit - rate commSQL.CommandText = "Update SMS_Credit Set Credit = " + price + " where Org_ID = '" + organization + "'" ElseIf operation = 2 Then 'Refund the price of a SMS Message. price = credit + rate commSQL.CommandText = "Update SMS_Credit Set Credit = " + price + " where Org_ID = '" + organization + "'" End If commSQL.ExecuteNonQuery() Am getting an exception telling me that the cast to from string to type double is not valid Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
mike55 Posted May 10, 2005 Author Posted May 10, 2005 Problem solved, apparently to use money, you have to supply the value as a string. Mike55 Quote A Client refers to the person who incurs the development cost. A Customer refers to the person that pays to use the product. ------ My software never has bugs. It just develops random features. (Mosabama vbforums.com)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.