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

Hoe can i connect the table into the c# application?

Answer Posted / umesh shrivastava

if we are using web application
1-open web.config file
<ConnectionString>
<add name="connect" connectionstring="Data Source=
,IntialCatalog= " Username= ,Password=
;providerName="System.Data.SqlClient"
</ConnectionString>
2-write namespace at the top in .cs file System.Data.SqlClient;
2-now write this code to button click event
String
ss=ConfigurationManager.ConnectionString["connect"].ConnectionString;
Sqlconnection con=new SqlConnection(ss);
con.open();
SqlCommand cmd=new SqlCommand("select * from emp",con);
SqlDataReader r=cmd.ExecuteReader();
con.close();

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the dispose method do with the connection object?

1020


Define satellite assembly in c#?

958


What is namespace in oops?

965


Define a partial class?

941


Can you create sealed abstract class in c#?

937


What is action c#?

949


What is the difference between iqueryable and ienumerable?

1028


What does using do in c#?

951


Explain about Destructor method?

1016


What is yield c#?

928


What is the purpose of a namespace?

908


Which program construct must return a value?

1119


What does == mean in c sharp?

1089


What is disco?

982


What is difference between for and foreach in c#?

1049