?
Solved

Update statement

Posted on 2006-11-08
7
Medium Priority
?
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 10

Expert Comment

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

Accepted Solution

by:
Kinger247 earned 2000 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:Praveen Kumar
ID: 17898869
what is this =>   txtstrmessage.CtlText ???

here no quotation:
ngassets = " & TextBox17.Text & "'  
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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:Praveen Kumar
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

764 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