J
JCauble
I have run into a snag with an application I am working on. Basically we get
data from an outside source. It's primary key is a string (kind of like a
Guid but 8 characters long). Some of these id's contain the @ symbol. The
problem is that when we go to try and get our data using the following
example it never returns our data even though the same query works in the DB.
select * from table_a where id = '@123ASCF'
The best guess I have is that the @ sign is the place holder for parameters
in the SqlCommand object. I have tried to put this value into a SqlParameter
object as well. I have tried changing it to a double @@, I also cannot
remove it as it's part of the primary key.
Also, I am unable to create stored procs and so need to find a solution that
will work using the SqlCommand / SqlReader objects to retrieve the data in
question. If I can escape it somehow to make it work that is fine too. I
just have no idea what I need to do and so far in looking at the code for the
SqlClient objects using reflector has turned up nothing usefull.
So, How in the world can I query this data from Ado.net using the SqlClient
objects?
Thanks for any help.
data from an outside source. It's primary key is a string (kind of like a
Guid but 8 characters long). Some of these id's contain the @ symbol. The
problem is that when we go to try and get our data using the following
example it never returns our data even though the same query works in the DB.
select * from table_a where id = '@123ASCF'
The best guess I have is that the @ sign is the place holder for parameters
in the SqlCommand object. I have tried to put this value into a SqlParameter
object as well. I have tried changing it to a double @@, I also cannot
remove it as it's part of the primary key.
Also, I am unable to create stored procs and so need to find a solution that
will work using the SqlCommand / SqlReader objects to retrieve the data in
question. If I can escape it somehow to make it work that is fine too. I
just have no idea what I need to do and so far in looking at the code for the
SqlClient objects using reflector has turned up nothing usefull.
So, How in the world can I query this data from Ado.net using the SqlClient
objects?
Thanks for any help.