Hi!
I have to search my database and display the search results in the datagrid.
Its happening fine. I have created a subroutine BindSearchData() and calling it from the Click event of a button. The routine takes the query as an argument. Follwing is the code
My problem is that when no records are found. I have to show it as a message " No Records found." I am coding in c# and a newbie.Code:private void BindSearchData(string strSearchSql) { OleDbConnection scnnNW = new OleDbConnection(SQL_CONNECTION_STRING); OleDbCommand scmd = new OleDbCommand(strSearchSql, scnnNW); OleDbDataAdapter sda = new OleDbDataAdapter(scmd); DataSet ds = new DataSet(); sda.Fill(ds); dgCompany.DataSource = ds; dgCompany.DataBind(); }
Pls help.




Reply With Quote