Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

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)

Posted

Problem solved, apparently to use money, you have to supply the value as a string.

 

Mike55

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)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...