Dear Experts

str = "Select * from gpass where vou_no= " & Val(Me.txtGat.Text) And Date =  Me.txtDat.Text

what is wrong in codes, please modify

Dim cmd As New SqlClient.SqlCommand("update gpass set c=@c, bno=@bno, code=@code, vehicle_no=@vehicle_no,trasportr=@transportr,time=@time where vou_no =  & Val(Me.txtGat.Text) and Date = me.txtdat.text)", con)

what is wrong in codes, please modify

1.

str = "Select * from [gpass] where [vou_no]=" & Val(Me.txtGat.Text) & "  And [Date] = '" &  Me.txtDat.Text & "'"

2.

Dim cmd As New SqlClient.SqlCommand("update [gpass] set [c]=@c, [bno]=@bno, code=@code, [vehicle_no]=@vehicle_no,[trasportr]=@transportr,[time]=@time where [vou_no]= @vou_no and [Date] =@date", con)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.