Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
GeneralRe: Browse all controls Pin
bouli2-Dec-04 5:02
bouli2-Dec-04 5:02 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 5:20
protectorHeath Stewart2-Dec-04 5:20 
GeneralRe: Browse all controls Pin
bouli2-Dec-04 5:30
bouli2-Dec-04 5:30 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 5:35
protectorHeath Stewart2-Dec-04 5:35 
GeneralRe: Browse all controls Pin
Judah Gabriel Himango2-Dec-04 5:37
sponsorJudah Gabriel Himango2-Dec-04 5:37 
GeneralRe: Browse all controls Pin
Heath Stewart2-Dec-04 7:30
protectorHeath Stewart2-Dec-04 7:30 
GeneralRe: Browse all controls Pin
turbochimp2-Dec-04 5:08
turbochimp2-Dec-04 5:08 
GeneralProblem with string literals Pin
pchak2-Dec-04 4:18
pchak2-Dec-04 4:18 
I'm having an issue with C# string literals. I'm trying to include double quotes in the string for a sql text. I've followed all the advice as to use either the backslash or "double double" quotes, but when I check the resulting output in the command window during debug, I get the backslahes showing up in the string.

code:
(backslash)
string s ="select ld_part, ld_lot, ld__dte01, ld_ref, ld_qty_oh, pt_um, (ld_qty_oh / (ld__dec01 * .012)) when pt_um = \"MS\" from ld_det, pt_mstr where ld_part like \"" + spec + "\" and pt_part = ld_part and ld__Dec01 > 0 and ld_ref= \"\" order by ld__dec01, ld__dte01";

(@ sign and double doubles)
string s = @"select ld_part, ld_lot, ld__dte01, ld_ref, ld_qty_oh, pt_um, (ld_qty_oh / (ld__dec01 * .012)) when pt_um = ""MS"" from ld_det, pt_mstr where ld_part like """ +spec+ @""" and pt_part = ld_part and ld__Dec01 > 0 and ld_ref= """" order by ld__dec01, ld__dte01";

output in command window(either way):
?sql
"select ld_part, ld_lot, ld__dte01, ld_ref, ld_qty_oh, pt_um, (ld_qty_oh / (ld__dec01 * .012)) when pt_um = \"MS\" from ld_det, pt_mstr where ld_part like \"12406%\" and pt_part = ld_part and ld__Dec01 > 0 and ld_ref= \"\" order by ld__dec01, ld__dte01"


desired result:
"select ld_part, ld_lot, ld__dte01, ld_ref, ld_qty_oh, pt_um, (ld_qty_oh / (ld__dec01 * .012)) when pt_um = "MS" from ld_det, pt_mstr where ld_part like "12406%" and pt_part = ld_part and ld__Dec01 > 0 and ld_ref= "" order by ld__dec01, ld__dte01"

Any ideas?
thanks!




Bill Polewchak
Technical Design Lead
Software Development/Architecture
Avery Dennison Corp.
GeneralRe: Problem with string literals Pin
turbochimp2-Dec-04 4:50
turbochimp2-Dec-04 4:50 
GeneralRe: Problem with string literals Pin
pchak2-Dec-04 5:30
pchak2-Dec-04 5:30 
Generalconnection path for database Pin
steve_rm2-Dec-04 4:18
steve_rm2-Dec-04 4:18 
GeneralRe: connection path for database Pin
turbochimp2-Dec-04 4:35
turbochimp2-Dec-04 4:35 
GeneralRe: connection path for database Pin
steve_rm2-Dec-04 5:20
steve_rm2-Dec-04 5:20 
Generalusing a TextBox without focus Pin
jjansen2-Dec-04 4:14
jjansen2-Dec-04 4:14 
GeneralC# compact framework Yes/No MessageBox Pin
DanielFP2-Dec-04 3:50
DanielFP2-Dec-04 3:50 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Dave Kreskowiak2-Dec-04 5:42
mveDave Kreskowiak2-Dec-04 5:42 
GeneralRe: C# compact framework Yes/No MessageBox Pin
Daniel P2-Dec-04 6:55
Daniel P2-Dec-04 6:55 
Generalfilling RichTextBox using MemoryStream Pin
Hovik Melkomian2-Dec-04 3:50
Hovik Melkomian2-Dec-04 3:50 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie2-Dec-04 4:47
leppie2-Dec-04 4:47 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian4-Dec-04 1:55
Hovik Melkomian4-Dec-04 1:55 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie4-Dec-04 2:23
leppie4-Dec-04 2:23 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian4-Dec-04 2:40
Hovik Melkomian4-Dec-04 2:40 
GeneralRe: filling RichTextBox using MemoryStream Pin
leppie4-Dec-04 3:33
leppie4-Dec-04 3:33 
GeneralRe: filling RichTextBox using MemoryStream Pin
Hovik Melkomian6-Dec-04 1:42
Hovik Melkomian6-Dec-04 1:42 
Generallibraries, DLL's, Wrappers Pin
Mridang Agarwalla2-Dec-04 2:50
Mridang Agarwalla2-Dec-04 2:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.