Datta
Datta

Reputation: 849

Conversion from string "update bk_details set totalcopie" to type 'Double' is not valid

where is wrong. I got error at line second. error is "Conversion from string "update bk_details set totalcopie" to type 'Double' is not valid."

   Dim totalbook As Integer
   totalbook = totalbook - 1
myConnection.Open()
                myCommand = New SqlServerCe.SqlCeCommand("update bk_details set totalcopies = '" + totalbook + "' where bid like '" + TextBox1.Text + "'", myConnection)
                myCommand.ExecuteNonQuery()
                myConnection.Close()

Upvotes: 0

Views: 49

Answers (1)

rodit
rodit

Reputation: 1766

`Always use '&' for string concatanation not +!

Also you should be using paramatised queries for SQL to make it safer!

Hope this helped, Rodi

Upvotes: 2

Related Questions