0

I need to apply the "&" operator in where clause...
the code is:

com = new OleDbCommand("select Accesstype from FTPSitesAuthorisation WHERE (SiteName = @site_name) & (UserName=@user_name)", conn);

It does not give any error,,, but the result is not correct , the "and" operation
is not applied...

please guide , where am I wrong...

Edited by __avd: Added code tags.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by saneeha.nust
0

Use and operator.

com = new OleDbCommand("select Accesstype from FTPSitesAuthorisation WHERE SiteName = @site_name and [UserName]=@user_name", conn);
com.Parameters.AddWithValue("@site_name","site_name_here");
com.Parameters.AddWithValue("@user_name","user_ame_here");

Edited by __avd: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.