So here is my problem: I have a site where I have to search through the stuff on it. This is my sql sentence:
public DataTable Search(string Keyword)
{
return db.GetData("SELECT * FROM tblBehandlinger WHERE fldYdelse LIKE @1",
"%" + Keyword + "%");
}
But as you can see it will only search through the table name "fldYdelse". And I works fine, but my problem is that it wont search through two things. This I how I want it to be:
public DataTable Search(string Keyword)
{
return db.GetData("SELECT * FROM tblBehandlinger WHERE fldYdelse LIKE
@1 OR fldPris @2", "%" + Keyword + "%");
}
This is my backend of the search.aspx site:
string keyword = Request.QueryString["search"].ToString();
foreach (DataRow item in s.Search(keyword).Rows)
{
//BLAH BLAH BLAH
}
But I can't list it out.