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

What are two important objects of ADO.Net?

1061


What are the different row versions available in table?

1026


What is DataRowCollection?

1146


What is ado or jdbc?

977


What are different layers of ADO.Net?

1144


How to bind the controls(best practice) comboboxes to the data in the dataset?

1095


Describe the command object and its method.

1045


Explain all the classes those are used for database connections between sql server and asp.net?

1058


What is the provider being used to access oracle database?

1045


How will you differentiate between ADO (ActiveX Data Object) and RDO (Remote Data Objects)?

1084


Explain the difference in record set and dataset?

991


What are the core objects of ADO.NET?

1087


What is the difference in record set and dataset?

1065


How to copy the contents from one table to another table and how to delete the source table in ado.net?

1082


What is ole word?

1010