Does SqlDataAdapter Requires open connection To Execute Sql Command ?
see below :
protected void Page_Load(object sender, EventArgs e)
{
string strconn = ConfigurationManager.ConnectionStrings["DBCS"].ConnectionString;
SqlConnection con = new SqlConnection(strconn);
SqlCommand cmd = new SqlCommand("Select * from EmpDetails", con);
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
GV_Data.DataSource = ds;
GV_Data.DataBind();
}
anyone have a clue about this ?