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

Explain how can we load multiple tables in to dataset?

945


How can we perform transactions in .net?

1061


What are the pre-requisites for connection pooling?

1007


Which is faster entity framework or ado.net?

939


how to create a quiz software using 4 options to answer and how to check with answers in the database and award marks....

4461


What is Dataset Object?

1012


What is data view and variable view?

929


What is the difference between typed and untyped dataset?

1093


What is csdl entity framework?

1027


What is the use of Dataview?

1135


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

1044


How to add a check box or a dropdown list to a column in a datagrid?

973


What are the difference between readonly vs. Const?

1017


What is row state?

989


What provider ado.net use by default? Explain the role of data provider in ado.net? What is the role of data provider in ado.net?

991