I have a C# web app were i want to run a SQL query based on the selection
from the drop down. I have 4 selections on the drop down and I can pass 3 of
them fine due to they are in the database. I have one selection that is "Show
All" which i want to show everything in the database in my grid.
I have this as my dynamic query:
OdbcCommand ProjectListCmd = new OdbcCommand("select * from news where
Group='" + NewsGroup+ "'", database);
if the user selects show all then i want it like this.
OdbcCommand ProjectListCmd = new OdbcCommand("select * from news, database);
How can i get this to work? I had a
if (NewsGroup == "Show All")
{
OdbcCommand ProjectListCmd = new OdbcCommand("select * from news,
database);
}else{
dynamic query}
but i kept getting errors for my datalist not defined data adapter not
defined, which they are