I am creating a VB application in Visual Studio 2010 that installs some SQL stored procedures. These stored procedures are encrypted otherwise I would just supply my clients with .sql files to create the stored procedures.
The install script that creates the stored procedure is 1500 lines in length and has been formatted in the way VS 2010 requires multi-line literals to be in:
"First Line" & _
"Second Line" & _
"etc..."
Every time I paste the multi-line script into Visual Studio the application crashes. Anyone have better way of assigning a very large string literal to a string variable. What I require is the following:
Imports System.Data.Sql Client
…
cmd cmd as SqlCommand
dim str as string
str = _
"Very" & _
"Long" & _
... 1500 lines ...
"String"
cmd.CommandText = str
or some other way of assigning a .sql script to a SqlCommand.
Thanks.
Could either paste it in Notepad and save it there, or split it in multiple strings that you just concatenate at the end.
Or even better, put the command in a resource file and load the resource at run time!