protected void Button1_Click(object sender, EventArgs e) { Label6.Text = ""; if (FromDate.SelectedDateValue.ToString() == "") { Label6.Text = "From date is not selected"; return; } if (Todate.SelectedDateValue.ToString() == "") { Label6.Text = "To date is not selected"; return; } Sql = "insert into BirthDayWish values('" + txt_name.Text + "','" + FromDate.SelectedDateValue.ToString() + "','" + txt_mobile.Text + "','" + Todate.SelectedDateValue.ToString() + "','a','" + txt_Email.Text + "')"; try { Dr = SCon.ReadSql(Sql); //GridView1.DataSource = Dr; //GridView1.DataBind(); Dr.Close(); } catch (Exception Ex1) { Response.Write(Ex1); } }