TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sousa Pambo
NA
92
24.2k
update using stringbuilder.append and doing operation
Nov 17 2015 6:02 AM
Hello everybody, I need your help on this problem, see...
Public Sub updateRequisicaoItemBar(ByVal r_id As Integer, ByVal qt As Integer, ByVal price As Double)
Dim sqlBuilder As New System.Text.StringBuilder()
With sqlBuilder
.Append("update tbl_Stock set ")
.Append("qtyEnviar='" & CDbl(.Append("qtyEnviar").ToString) + qt - CDbl(.Append("qty").ToString) & "',")
.Append("qty='" & qt & "',")
.Append("PU='" & preco & "'")
.Append("valor='" & (.Append("qty").ToString * price) & "',")
.Append("sent='" & 0 & "'")
.Append(" where id='" & r_id & "'")
End With
Using cn As SqlConnection = New SqlConnection(getConnectionStringFinance())
Try
cn.Open()
Using cm As SqlCommand = New SqlCommand(sqlBuilder.ToString, cn)
cm.ExecuteNonQuery()
MessageBox.Show("Updated")
End Using
Catch ex As Exception
MessageBox.Show(ex.ToString)
End Try
End Using
End Sub
The red lines seem not doing in the right way, what the right way doing this. please help
Reply
Answers (
0
)
IntPtr
Print in C# with ASP.NET MVC