Here is my code...
<%-- <%-- | |||||||||
cs code;
protected void Button1_Click(object sender, EventArgs e)
{
bind();
}
public void bind()
{
try
{
Con.Open();
Sdap = new SqlDataAdapter("select T_Id,[Name],Class,Section from student where Section='" + DropDownList1.SelectedItem.ToString() + "'", Con);
DataSet Ds = new DataSet();
Sdap.Fill(Ds);
GridView1.DataSource = Ds;
GridView1.DataBind();
}
catch (Exception Ex)
{
Response.Write(Ex.ToString());
}
finally
{
Con.Close();
}
}


Satyapriya NayakRank #47 · 31.5K reputationPosted Sep 12, 2013, 9:31 PM EDT
Suthish NairRank #92 · 22.8K reputationPosted Sep 13, 2013, 3:59 AM EDT