Sql problem in C# ASP.NET
- From: "Zarkill" <zarkill@xxxxxxxxx>
- Date: 14 Nov 2005 02:43:08 -0800
Hello,
I have made a Sql Statement, but it doesn't work. This is the
statement:
sqlStatementDataGrid = "SELECT * FROM Apparatuur WHERE ApparatuurID > "
+ lblPage.Text + " AND WHERE ApparatuurID <= " + (lblPage.Text + 5) ;
And this is the error:
Incorrect syntax near the keyword 'WHERE'.
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.SqlClient.SqlException: Incorrect syntax
near the keyword 'WHERE'.
Source Error:
Line 155: }
Line 156: SqlConnection MyConnection = new
SqlConnection(ConnectionString);
Line 157: dsDgrApparatuur = SqlHelper.ExecuteDataset(MyConnection,
CommandType.Text, sqlStatementDataGrid);
Line 158: dgrApparatuur.DataSource = dsDgrApparatuur;
Line 159: dgrApparatuur.DataBind();
Does anyone know what I'm doing wrong..?!
.
- Follow-Ups:
- Re: Sql problem in C# ASP.NET
- From: Jarl Hermansson
- Re: Sql problem in C# ASP.NET
- Prev by Date: Foreign Keys
- Next by Date: Re: Sql problem in C# ASP.NET
- Previous by thread: Foreign Keys
- Next by thread: Re: Sql problem in C# ASP.NET
- Index(es):
Relevant Pages
|