Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys, my sql statement is too long. Ive broken it up and added enviroment.newline
however its still not reading properly, any tips or ideas on where im going wrong?
much appreciated

thankyou Louise :)

SQL
DA.UpdateCommand = new SqlCommand("UPDATE BookDetails SET TITLE = @TITLE,  AUTHORFIRSTNAME = @AUTHORFIRSTNAME" + Environment.NewLine +
        "AUTHORSURNAME = @AUTHORSURNAME, ACQUISITIONDATE = @ACQUISITIONDATE,PUBLISHERNAME = @PUBLISHERNAME, ISBN = @ISBN" + Environment.NewLine +
        "DDCLASSIFICATION = @DDCLASSIFICATION WHERE BOOKID = @BOOKID)", SC);
Posted

1 solution

"my sql statement is too long" Too long how? The SQL processor doesn't care about line breaks so I'm assuming you mean for readability in the code editor. In that case Environment.NewLine does nothing, it is meant for output.

C#
string longString = @"Some long string
    that is broken into
    multiple lines";
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900