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

How to pass values into a datatable?

1138


What is the difference between ado.net and entity framework?

1049


If we are not returning any records from the database, which method is to be used?

1329


How do you implement locking concept for dataset?

996


What is execute scalar in ado.net?

965


What is ado code?

950


In how many ways we can retrieve table records count? How to find the count of records in a dataset?

1009


Give few examples of datareader that is used in different dataproviders.

980


What is executenonquery ado.net?

932


Which property is used to check whether a DataReader is closed or opened?

1049


Which components of a data provider is used to retrieve, insert, delete, or modify data in a data source?

1141


What do you know about ado.net's methods?

1112


What do you mean by performing asynchronous operation using command object?

1038


What is the difference between statement and preparedstatement interface?

997


What is full form of ado?

1065