Click here to Skip to main content
15,890,506 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Dim pre As Integer = dr.Item("receved")
                Dim newrec As Integer = CInt(receved) + pre

                cmd1.CommandText = "update feerpt set receved=" & newrec & " where studentid=" & studentid & ""
                cmd1.ExecuteNonQuery()
Posted
Comments
What is the issue here?

not sure what your issue is

surely you just do

SQL
"update feerpt set receved = receved + " & newrec & " where studentid ..... 


yes ?
 
Share this answer
 
Try this:
"update feerpt set receved=receved + " & newrec & " where studentid='" & studentid & "'"

However, you should use Parameterized-queries-to-prevent-SQL-Injection-Attacks-in-SQL-Server.aspx[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900