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...

Recommended Answers

All 2 Replies

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");

thanks alot... It works....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.