searching a datasource
Guys I am tring to search my data source. Everytime I press the button nothing is displayed. I have stored the textbox entries into string variables and then entered them into a select statement. and then used a dataset set filled it using the data adapter with the entries which were selected using the modified select statement and then display this in a datagrid. No result though. I think that it maybe due to how I store the textbox values. Here is my code: -
private void Button_Click(object sender, System.EventArgs e)
{
String strAuthor = Author.Text;
String strTitle = Title.Text;
Connect();
String strSearch = "SELECT Computing Where BookAuthor = " + strAuthor + " OR BookTitle =" + strTitle;
OleDbDataAdapter objAdapter = new OleDbDataAdapter(strSQL, objConnection);
DataSet ds = new DataSet();
objAdapter.Fill(ds, "dtFilteredComputing");
Disconnect();
dgComputing.DataSource = ds.Tables[0].DefaultView;
dgComputing.DataBind();
}
THanks
Adz
Adz - Portsmouth Massive
__________________
Adz - Learning The J2EE Ways.
|