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

Does executenonquery return a value?

933


What is connection string?

990


What are the namespaces used in ado.net for data access?

968


How do you find the count of records in a dataset?

956


What is the difference between executequery and executenonquery?

894


What is ado.net object model?

967


What is difference in record set and dataset?

1053


How to add an aggregate column?

990


How is entity framework different from ado.net?

934


What is executequery?

937


Which object is used to add relationship between two Datatables?

1029


What is ado in agriculture?

940


How many major types of connection objects in ADO.NET?

1012


What is ado.net in mvc?

912


Explain the advantage of ADO.Net?

973