[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I break up a long SQL Select onto multiple lines of code?

Posted on 2009-02-24
4
Medium Priority
?
383 Views
Last Modified: 2012-05-06
I have a long SELECT I would like to see all at once.

I have tried the code below, but that gets filled with squiggly lines and Visual Studio adds the quotation mark after JobID, like this....

        Dim JobCommand As String = "SELECT JobID, _"

        Dim JobCommand As String = "SELECT JobID, _
            JobTitle, _
            DateLastModified, _
            Employer.EmpID, _
            Employer.Emp_BusinessName _
            FROM [Jobs], [Employer] _
            WHERE Jobs.EmpID = Employer.EmpID AND"

The underscore works fine for breaking my Response.Write string over multiple lines.

ASP.NET with VB
SELECT JobID, _JobTitle, DateLastModified, Employer.EmpID, Employer.Emp_BusinessName FROM [Jobs], [Employer] WHERE Jobs.EmpID = Employer.EmpID AND

Open in new window

0
Comment
Question by:spaceneedlejumper
  • 2
4 Comments
 
LVL 10

Accepted Solution

by:
lucius_the earned 540 total points
ID: 23724382
Try this:
Dim JobCommand As String = "SELECT JobID, " & _
    "JobTitle, " & _
    "DateLastModified, " & _
    "Employer.EmpID, " & _
    "Employer.Emp_BusinessName " & _
    "FROM [Jobs], [Employer] " & _
    "WHERE Jobs.EmpID = Employer.EmpID AND"

Open in new window

0
 
LVL 16

Assisted Solution

by:burakiewicz
burakiewicz earned 460 total points
ID: 23724385
  Dim JobCommand As String = "SELECT JobID, " & _
        "JobTitle, " & _
        "Employer.EmpID," & _
            "Employer.Emp_BusinessName" & _
            "FROM [Jobs], [Employer]" & _
            "WHERE(Jobs.EmpID = Employer.EmpID And '')
0
 
LVL 10

Assisted Solution

by:lucius_the
lucius_the earned 540 total points
ID: 23724394
Explanation: strings need to be closed with " before you can brake them in more lines
0
 

Author Closing Comment

by:spaceneedlejumper
ID: 31550699
You guys are savin' my bacon!

Thank you!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
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…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

830 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