Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error CS1026

Status
Not open for further replies.

knight1001

Technical User
Nov 29, 2004
14
0
0
GB
I have Error CS1026 for this line of Code:

commandx = new OleDbCommand("SELECT [Username] FROM Users WHERE [Username]= "Username = Request.Form("Username");

I can't figure out why i am recieving this error on that line.
 
sorry that line was wrong: this is the script

Line 21: if (!(IsPostBack))
Line 22: {
Line 23: commandpartthree = new OleDbCommand("SELECT [Username] FROM Users WHERE [Username]= "Username = Request.Form("Username"));
Line 24: commandpartthree.Connection = connectionpartthree;
Line 25: connectionpartthree.Open();
 
Shouldn't it be:

commandpartthree = new OleDbCommand("SELECT [Username] FROM Users WHERE [Username]= " + Request.Form("Username"));

Lee
 
actually this looks like a .net question (new OleDbCommand is .net), and this forum is for classic asp try forum855

but i believe the problem is in your sql

try you sql like this
Code:
commandpartthree = new OleDbCommand("SELECT [Username] FROM [Users] WHERE [Username]='" & Request.Form("Username") & "'");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top