DataAdapter control to load your generated dataset

Posted by Saranya Boopathi under C# on 6/26/2013 | Points: 10 | Views : 849 | Status : [Member] | Replies : 1
Hi,
Which method do you invoke on the DataAdapter control to load your generated dataset with data?

Saranya Boopathi


Responses

Posted by: Sushant on: 6/26/2013 [Member] Starter | Points: 25

Up
0
Down
use data table to load table in database
ex:-

public void GetFloorPlan()
{
cmd = new SqlCommand("Select FloorId,FloorTitle,FloorMapUrl,DisplayOrder,GroupName From FloorPlanDetail Where ProjId='" + Request.QueryString["ProjectId"].ToString() + "'", cn);
cmd.CommandType = CommandType.Text;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
da.Fill(dt);
if (dt.Rows.Count > 0)
{
dlFloorPlanDetail.DataSource = dt;
dlFloorPlanDetail.DataBind();
}
dr.Close();
}

Sushat

Saranya Boopathi, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response