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

How can we save all data from dataset?

982


What is the difference in record set and dataset?

1014


What is the use of Dataview?

1112


Describe briefly an ADO.NET Dataset ?

1063


What is basic use of data view?

987


What is DataRowCollection?

1089


What are three methods for displaying data in a syncfusion datagrid

1057


What is data relation?

884


What is the use of connection object in ado.net?

1037


Explian About DataAdapters

1007


What are two important objects of ADO.Net?

1007


What is ado or jdbc?

907


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

968


What is connection in ado.net?

933


Which is the best method to get two values from the database?

953