can anyone tell me how to use if else statement using c# and MS Access database..this is my code..
protected void Button2_Click(object sender, EventArgs e)
{
string path = Server.MapPath("App_Data\\dnis2010.mdb");
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path);
//con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Users\\keOn_kAyFar\\Documents\\Visual Studio 2008\\WebSites\\DNIS\\App_Data\\dnis2010.mdb;Persist Security Info=False";
conn.Open();
string str = "SELECT Type,Department,COUNT(RAM) FROM tableRegister WHERE RAM LIKE '%" + TextBox1.Text + "%' GROUP BY Type,Department";
OleDbDataAdapter da = new OleDbDataAdapter(str, conn);
DataSet ds = new DataSet();
ds.Clear();
da.Fill(ds, "tableRegister");
GridView1.DataSource = ds;
GridView1.DataMember = "tableRegister";
GridView1.DataBind();
conn.Close();
}