I've searched a few websites and none of them meantion how to break up really long lines of code like a sql query.
The sql statement looks like this (I've broked it down so it can fit in the post):
String sSQL = "SELECT dbo.Issues.CreatedDate as Created, dbo.Issues.ModifiedDate as Modified, dbo.Issues.Field1 AS Repro, dbo.Issues.Field3 AS Notes dbo.Issues.Field2 as Priority, dbo.Issues.Field11 AS Build, dbo.Issues.Field12 as Description, dbo.Issues.Field25 AS VersionIn, dbo.Issues.Field26 As VersionFixed dbo.Issues.ID,dbo.Types.Name AS Type, dbo.Issues.Synopsis dbo.States.Name AS State, dbo.States.ID AS StatesID, dbo.Users.Name AS [User], dbo.Projects.Name AS Projects FROM dbo.Issues INNER JOIN dbo.Projects ON dbo.Issues.ProjectID = dbo.Projects.ID INNER JOIN dbo.States ON dbo.Issues.StateID = dbo.States.ID INNER JOIN dbo.Types ON dbo.Issues.TypeID = dbo.Types.ID INNER JOIN dbo.Users ON dbo.Issues.AssignedUserID = dbo.Users.ID WHERE ( dbo.Projects.ID = 66)";
I'm not sure if this post should be here, but I figured it is worth a shot. Thanks for any advice.
Newbie19
4 2193
You shouold be able to: -
String sSQL = "SELECT dbo.Issues.CreatedDate as Created,"
-
+ " dbo.Issues.ModifiedDate as Modified,"
-
+ " dbo.Issues.Field1 AS Repro,"
-
+ " dbo.Issues.Field3 AS Notes dbo.Issues.Field2 as Priority,"
-
+etc....
-
You shouold be able to: -
String sSQL = "SELECT dbo.Issues.CreatedDate as Created,"
-
+ " dbo.Issues.ModifiedDate as Modified,"
-
+ " dbo.Issues.Field1 AS Repro,"
-
+ " dbo.Issues.Field3 AS Notes dbo.Issues.Field2 as Priority,"
-
+etc....
-
Thank you very much, C# is more like Java then I realized.
Thanks again,
Newbie19
Plater 7,872
Recognized Expert Expert
Thank you very much, C# is more like Java then I realized.
Thanks again,
Newbie19
You can also do: -
String sSQL = "";
-
sSQL += "SELECT dbo.Issues.CreatedDate as Created,";
-
sSQL += " dbo.Issues.ModifiedDate as Modified,"
-
sSQL += " dbo.Issues.Field1 AS Repro,"
-
sSQL += " dbo.Issues.Field3 AS Notes dbo.Issues.Field2 as Priority,"
-
//sSQL += etc....
-
(There is a "cost" with this as it re-creates the string everytime.)
If you are going to need a lot of concatenations best option is likely the System.Text.StringBuilder which overcomes the performance issues of +=
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Michael Satterwhite |
last post by:
I have a survey form that I want mailed to the client. I've built the
message body as plain text and tested it by writing it to a file and
examining the file. It's being built correctly.
When I...
|
by: Frances Del Rio |
last post by:
is there a non-breaking hyphen in HTML?? for example, so a phone no.
falls all on one line.. as in..
1-800-444-5454... (and is not broken into two lines if phone no. occurs
near end of a...
|
by: The Bicycling Guitarist |
last post by:
Hi. I found the following when trying to learn if there is such a thing as a
non-breaking hyphen. Apparently Unicode has a ‑ but that is not
well-supported, especially in older browsers. Somebody...
|
by: vic y |
last post by:
Created a SP that uses system function XP_SENDMAIL. I want
to be able to send a HYPERLINK in the email. The
HYPERLINK is created dynamically and generally long in length (exceeds
default width of...
|
by: stevenkobes |
last post by:
If a word has a hyphen in it, IE will permit a line break at the
hyphen, but Firefox/Mozilla won't. Apparently the Firefox behavior is
standards-compliant, but it is not what I want. Is there a...
| |
by: BerkshireGuy |
last post by:
Hello everyone,
I am reading a query's SQL string and adding criteria to that and then
resaving it. I know, might not be the best method, but it seems to
work and there are some pros to doing...
|
by: tony |
last post by:
If you have any PHP scripts which will not work in the current releases
due to breaks in backwards compatibility then take a look at
http://www.tonymarston.net/php-mysql/bc-is-everything.html and...
|
by: elmar |
last post by:
Hi Clers,
If I look at my ~200000 lines of C code programmed over the past 15
years, there is one annoying thing in this smart language, which
somehow reduces the 'beauty' of the source code...
|
by: iheartvba |
last post by:
Hi I have got the following code from someone else
Sub MultiColsToA()
Dim rCell As Range
Dim lRows As Long
Dim lCols As Long
Dim lCol As Long
Dim ws As Worksheet
...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |