Solved

Update statement

Posted on 2006-11-08
7
175 Views
Last Modified: 2010-04-23
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)
   
0
Comment
Question by:running32
7 Comments
 
LVL 10

Expert Comment

by:Kinger247
ID: 17898846
missing single quote in (lngassets = ) !
0
 
LVL 10

Accepted Solution

by:
Kinger247 earned 500 total points
ID: 17898853
Should be this :

        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)
0
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 17898869
what is this =>   txtstrmessage.CtlText ???

here no quotation:
ngassets = " & TextBox17.Text & "'  
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
LVL 13

Expert Comment

by:newyuppie
ID: 17898903
my, FAST READERS! its impossible to keep up...
0
 

Author Comment

by:running32
ID: 17898911

Opps, great thanks
0
 
LVL 10

Expert Comment

by:Kinger247
ID: 17898918
I'm on my 7th coffee ny ! ...
getting a bit jittery though now ;)
0
 
LVL 12

Expert Comment

by:Mamtha1982
ID: 17898927
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, ..............)
0

Featured Post

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question