hmcgeehan
asked on
SQL Statement in C#
Hi
Im trying this but it gives me 0 results.
string pcname = "\\pc024";
populateListBox(listBoxPro cessesOnSe lectedMach ine, "SELECT processtype FROM processes WHERE processname = '" + pcname + "'", false);
I try this in SQL SERVER and it gives me three results
SELECT processtype
FROM processes
WHERE processname = '\\pc024'
Am I missing something blatant?
Thanks
Im trying this but it gives me 0 results.
string pcname = "\\pc024";
populateListBox(listBoxPro
I try this in SQL SERVER and it gives me three results
SELECT processtype
FROM processes
WHERE processname = '\\pc024'
Am I missing something blatant?
Thanks
by using @ you are telling the string to act as is, if you use \\, this is in terpretted as \ without the @
ASKER
Thanks
Just another small question
I have a listbox and its contents are
\\pc001
\\pc002
etc
but if I do
pcname = listBox1.SelectedItem.ToSt ring();
it says
pcname = \\\\pc001
Just another small question
I have a listbox and its contents are
\\pc001
\\pc002
etc
but if I do
pcname = listBox1.SelectedItem.ToSt
it says
pcname = \\\\pc001
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
string pcname = "\\pc024";
to this
string pcname = @"\\pc024";