Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I'm writing a program that requires some very long SQL statements to retrieve data from the database. Some of these strings are 50 lines.

 

For long strings like that, it gets tedious to write it in as Strings like

 

" something something " & _

" something else " & _

" more something " & _

" something again " & _

" something " & _

[...] & _

" end of my string "

 

I don't want to use & _ all over the place, because it makes the SQL harder to follow, and it's a hassle to put them in.

 

In another language, this wouldn't be a problem, but they want us to use VB.NET...

 

So I was thinking I either find a way to do this gracefully in VB.NET, or put the string somewhere else (like in a text file or an XML file) and then load it into a string object somehow.

 

How do I do that?

Posted

I would used stored procedures, except that I am currently using Access, but will need to transfer over the system to SQL Server eventually. The system will connect to a central database system that I don't have full control over. For that reason, I have refrained from using stored procedures as much as possible, opting to handle everything from code.

 

Now all of a sudden, this belongs in the Database forum, and not here.... ah well.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...