Might be an easy question, but I'm very new to ASP.net and I keep getting the exception
There was an error parsing the query. [ Token line number = 1,Token line offset = 142,Token in error = ]
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlServerCe.SqlCeException: There was an error parsing the query. [ Token line number = 1,Token line offset = 142,Token in error = ]
All I'm trying to do is get my grid view to only display results that are similar to whatever the user puts in the text box.
protected void Button1_Click(object sender, EventArgs e)
{
string query = TextBox1.Text;
string sql = "SELECT [Username], [Job Description] AS Job_Description, [Hours Worked] AS Hours_Worked, [Date], [ID] FROM [TimeData]"; // this one works fine
string sql2 = "SELECT [Username], [Job Description] AS Job_Description, [Hours Worked] AS Hours_Worked, [ID], [Date] FROM [TimeData] WHERE ([Username] == '" +query + "'";
Response.Write("done");
SqlDataSource1.SelectCommand = sql2;
}
I'm using a datasource from a local .SDF file.
Thanks in advance
(from yourWHEREclause and it will be=not==.