Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Sequence to connect and retrieve data from database useig
dataset ?

Answer Posted / a.anwar sadat

public SqlConnection con = new SqlConnection("server=anwar;
uid=sa; pwd=s;database=Employee;");
public SqlCommand cmd;
public SqlDataAdapter da;
public DataSet ds;

cmd = new SqlCommand("select * from empdetails", con);

da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds, "empdetails");
foreach(DataRow dr in ds.Tables["empdetails"].Rows)
{
txtempname.Text = dr["name"].ToString();
txtdob.Text = dr["dob"].ToString();
txtstreetname.Text = dr["street"].ToString();
} // foreach

Is This Answer Correct ?    13 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which one of the objects is a high-level abstraction of the connection and command objects in ado.net?

1106


Define executenonquery?

874


What is the difference between DataReader and DataSet in ADO.NET?

1095


What is connection pooling and what is the maximum pool size in ado.net connection string?

915


What is connected architecture in ado.net?

1000


What is acid in ado.net?

967


Describe briefly an ADO.NET Dataset ?

1022


How do we use stored procedure in ADO.NET and how do we provide parameters to the stored procedures?

934


What is bubbled event can you please explain?

982


What is namespace in ado.net?

961


What is ado asp?

959


What is bubbled event?

925


Explain the various objects in dataset.

945


What are the major difference between classic ADO and ADO.NET?

957


What is the maximum pool size in ado.net connection string?

902