Link to home
Start Free TrialLog in
Avatar of running32
running32

asked on

Update statement

What am I missing please I Keep getting an error that I have unclosed quotation marks.  Thanks

    Dim cmd6 As New SqlClient.SqlCommand("update tblPAScreen set dtmdate = '" & txtdtmtoday.Text & "',lngstaffid = '" & PAStaffid & "',strActionTaken = '" & ComboBox2.Text & "',strfname = '" & txtstrpfname.Text & "', strlname = '" & txtstrplname.Text & "',strcfname = '" & txtstrfname.Text & "',strclname = '" & txtstrlname.Text & "',dtmdob = '" & txtdob.Text & "',strhphone = '" & txtstrphone.CtlText & "',strwphone = '" & txtstrmessage.CtlText & "',straddress = '" & txtaddress.Text & "',strcity = '" & txtcity.Text & "',strstate = '" & txtstate.Text & "',strzip = '" & txtzip.Text & "',strmaddress = '" & txtmaddress.Text & "',strmcity = '" & txtmcity.Text & "',strmstate = '" & txtmstate.Text & "',strmzip = '" & txtmzip.Text & "',ysnRXInsurance = '" & rxins & "',ysnVeteran = '" & veteran & "',ysnMedicare = '" & medicare & "',strreferredby = '" & txtstrreferby.Text & "',strPrescribingdr = '" & txtstrDoctorRX.Text & "',inthhsize = '" & txtinthousehold.Text & "',strPharmacy = '" & TextBox3.Text & "',dtmappt = '" & txtdtmappointment.Text & "',dtmappttime = '" & txtdtmappttime.Text & "',lngadvocate = '" & PAAdvocateid & "',strnotes = '" & TextBox1.Text & "',lngassets = " & TextBox17.Text & "',lngpatientid = '" & txtid.Text & "', lngstatus = '" & status & "' where lngScreenid = '" & screenid & "'", Connection1)
   
Avatar of Kinger247
Kinger247

missing single quote in (lngassets = ) !
ASKER CERTIFIED SOLUTION
Avatar of Kinger247
Kinger247

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what is this =>   txtstrmessage.CtlText ???

here no quotation:
ngassets = " & TextBox17.Text & "'  
my, FAST READERS! its impossible to keep up...
Avatar of running32

ASKER


Opps, great thanks
I'm on my 7th coffee ny ! ...
getting a bit jittery though now ;)
Just for you future refference runnung32,
next time try to use String.Format function, very easy to debug.

Ex:
Dim Update As String
Update= String.Format("update tblPAScreen set dtmdate = '{0}', lngstaffid = '{1}, ................ ",  txtdtmtoday.Text,
PAStaffid, ..............)