G
Guest
hi,
I have a question regarding the following senario:
I have a query (not a stored procedure):
"SELECT memberID, email from tbl_User Where login = @login"
And then I use the addWithValue method new to 2.0 to add it like the
following:
cmd.parameters.addWithValue("@login", login)
Assuming the column [login] is of type nVarchar(50), how can I be sure that
when I addWithValue, the data is passed as nvarchar? I am a bit confused
because in the query I did not Declare @login nvarchar(50) as I normally
would with stored procedure. Or should I construct the query as
"SELECT memberID, email from tbl_User Where login = N'" + login + "' "
instead?
What about the senario when the column [login] is of type varchar(50)?
Assuming that the response and request encoding in my ASP.NET 2.0 application
are both "UTF-8", will I be able to work with non-unicode column with
AddWithValue without specifying the parameter data type? Or will ADO do the
job for me by first discovering the data type?
I have a question regarding the following senario:
I have a query (not a stored procedure):
"SELECT memberID, email from tbl_User Where login = @login"
And then I use the addWithValue method new to 2.0 to add it like the
following:
cmd.parameters.addWithValue("@login", login)
Assuming the column [login] is of type nVarchar(50), how can I be sure that
when I addWithValue, the data is passed as nvarchar? I am a bit confused
because in the query I did not Declare @login nvarchar(50) as I normally
would with stored procedure. Or should I construct the query as
"SELECT memberID, email from tbl_User Where login = N'" + login + "' "
instead?
What about the senario when the column [login] is of type varchar(50)?
Assuming that the response and request encoding in my ASP.NET 2.0 application
are both "UTF-8", will I be able to work with non-unicode column with
AddWithValue without specifying the parameter data type? Or will ADO do the
job for me by first discovering the data type?