frazza Posted October 3, 2003 Posted October 3, 2003 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? Quote
Administrators PlausiblyDamp Posted October 3, 2003 Administrators Posted October 3, 2003 What database are you using. If Oracle or SQL Server you would be much better off using Stored Procedures rather than just concatenating strings. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
frazza Posted October 3, 2003 Author Posted October 3, 2003 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.