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...

What are the steps in connecting to database ?

Answer Posted / kalirajan

// Declare Namespace as ur Lang...
In c#

Using System.Data.SqlClient;

//connection

SqlConnection con = new
SqlConnection("server=localhost;database=Grid_Db;uid=sa;pwd=;");

con.Open();

SqlCommand cmd = new SqlCommand("select * from Gtid_Tbl",con);

SqlDataAdapter da = new SqlDataAdapter(cmd);

DataSet ds = new DataSet();

da.Fill(ds);

GridView1.DataSource = ds;
GridView1.DataBind();

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are all the commands used with Data Adapter?

1043


What is basic use of data view?

1006


Which database is the ado.net?

976


List all the steps in order, to access a database through ado.net?

1084


What is ole2 format?

904


Which namespaces are used for data access?

1213


What is ado or jdbc?

924


Explain how do you connect to sql server database without using sqlclient?

1007


What is the full form of ado?

1012


What are the different row versions available in table?

977


How to creating a SqlCommand Object?

1140


What are the data access namespaces in .NET?

1212


How to maintain the relation between two tables in ADO.NET?

1012


Explain About ado.net components/objects. Usage of data adapters and tell the steps to retrieve data.

1110


What is ado and rdo?

901