troubleshooting Question

Large SQL Query Text in String Variable

Avatar of Delboy
DelboyFlag for United Kingdom of Great Britain and Northern Ireland asked on
Visual Basic Classic.NET ProgrammingVisual Basic.NET
15 Comments2 Solutions995 ViewsLast Modified:
Hi All
I use VB.Net in VS2005 and create my own query string in many of my applications to create a dataset etc. for example when I build a new SQL String I start
Dim SQL ="Select * From Table" 'new line  
SQL+= " Where This ='" & TextBox.Text & "'" etc.

But sometimes I have a pre-defined query already written but not stored as a View in SQL Server, which is quite big, say 70 lines long.  And from time to time I can amend the query in SQL Designer to change it when necessary.  My question (eventually :) ) is can I create a very large string varaible without having to split it line by line like this

Dim SQL = "Select BLAH BLAH
BLAH BLAH BLAH
BLAH BLAH BLAH"

Instead of

Dim SQL = "Select BLAH BLAH"
SQL += "BLAH BLAH BLAH"  
SQL += "BLAH BLAH BLAH"

I hope I have made sense..  

Kind regards

Derek.
ASKER CERTIFIED SOLUTION
kworks

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros