Link to home
Start Free TrialLog in
Avatar of wademi
wademi

asked on

How to continue a long query on a new line in c#.net

I have a long query like this:

"select requests.id,requests.disposition,requests.staff_ID,(contacts.First_Name+' ' +contacts.Last_Name) as Contact,contacts.Office_telephone,requests.project_title,requests.create_date,text_file.text_field from requests,contacts,text_file where requests.create_date >= (SELECT CAST(CONVERT(CHAR(11),GETDATE(),113) AS datetime)) and requests.Primary_contact_ID = Contacts.ID and requests.Project_Description_Id = text_file.id order by requests.id desc";

How do i write this query onmultiple lines in C#.net?
Is there some special character that you can put after the end of each line so that  its recognized as a continuation of the query on the previous line?

Currently I have this query on one long line and I have to scroll all the way across to edit something at the end of the line
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
note that, actually, you should make that query into a view or a stored procedure/function, so to limit your sql in the application to just a minimum code, resp:
* exec procedure
* select * from view_name
* select * from dbo.function_name() alias
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial