U
Uriah Piddle
Hi Gang,
In sql Server 2005, I am running a query with an nvarchar param in the WHERE
clause like this:
.. . .
@Bar nvarchar
.. . .
Select * From Foo WHERE Foo.Bar = @Bar
The problem: this query is returning nothing when I KNOW that there is a
record that matches.
I send the query in an SQLCommand object like this:
SQLCommand cmd = new SQLCommand("GetLicenses", cn)
cmd.CommandType = CommandType.StoredProcedure;
string bar = "Admin";
cmd.Parameters.Add("@Bar", SqlDBType.NVarChar).Value = bar;
This query runs correctly when I change it to query on an Int column so the
code itself works. But querying on the nvarchar column with the string just
does not work.
Thanks for any ideas.
Steve
In sql Server 2005, I am running a query with an nvarchar param in the WHERE
clause like this:
.. . .
@Bar nvarchar
.. . .
Select * From Foo WHERE Foo.Bar = @Bar
The problem: this query is returning nothing when I KNOW that there is a
record that matches.
I send the query in an SQLCommand object like this:
SQLCommand cmd = new SQLCommand("GetLicenses", cn)
cmd.CommandType = CommandType.StoredProcedure;
string bar = "Admin";
cmd.Parameters.Add("@Bar", SqlDBType.NVarChar).Value = bar;
This query runs correctly when I change it to query on an Int column so the
code itself works. But querying on the nvarchar column with the string just
does not work.
Thanks for any ideas.
Steve