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 / reply2anwar

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

private void RetriveData()
{
cmd = new SqlCommand("select * from empdetails", con)
DataSet ds = new DataSet();
using(da = new SqlDataAdapter(cmd))
{

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 ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we perform transactions in .net?

1060


What connected data?

962


How would you connect to a database by using .NET?

939


What are the disadvantages of using datalist?

1031


Which is faster ado.net or linq?

1026


What are the benefits of using of ADO.NET in .NET 4.0?

1072


What is basic use of data view?

1006


Explain what is datagrid with an example?

1098


Which ado.net object is very fast in getting data from the database?

1105


What is the difference between sqlcommand and sqldataadapter?

997


Which is faster datareader or dataadapter?

992


Give an example that shows how to execute a stored procedure in ado.net?

1071


What is ole access?

948


If a table contains 20000 records . In a page at each time 100 records to be displayed what are the steps you will take to improve performance? Will you use dataset or datareader?

1055


Which method is used to sort the data in ADO.Net?

1978