Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How can we do connectivity with database in asp.net ? With Example.
Posted
Comments
__TR__ 3-Sep-12 5:58am    
I would suggest you to take a look at the rules for posting before posting a question here next time.
Code Project Quick Answers FAQ[^]

Sorry I am not demoralising you but please try to do it by your self then your basics will be Clear.
then you will be Perfect in .Net.
if you search on Google then you will get 57,100,000 results (0.22 seconds)

Try
Google
 
Share this answer
 
v2
Comments
mahesh1529 3-Sep-12 5:52am    
Good One My 5!!!!
Manas Bhardwaj 3-Sep-12 6:22am    
5+
Mohamed Mitwalli 3-Sep-12 6:22am    
5+
sunandandutt 3-Sep-12 7:54am    
Thanks!!!!!!!!!!!
There are lot of article available on internet, go out and look for them.

Here is one on MSDN, looks decent:
http://msdn.microsoft.com/en-us/library/ms178371(v=vs.100).aspx[^]
 
Share this answer
 
Comments
__TR__ 3-Sep-12 6:10am    
My 5!
Manas Bhardwaj 3-Sep-12 6:44am    
thx!
Mohamed Mitwalli 3-Sep-12 6:22am    
5+
Manas Bhardwaj 3-Sep-12 6:44am    
thx!
Prasad_Kulkarni 3-Sep-12 7:09am    
My 5
Take a look at the below CP articles.
A Beginner's Tutorial for Understanding ADO.NET[^]
Using ADO.NET for beginners[^]

For more resource you can Google[^]

Also search for articles in CP Here[^]
 
Share this answer
 
Comments
D-Kishore 3-Sep-12 5:58am    
yes 5
__TR__ 3-Sep-12 6:40am    
Thanks Kishore.
Mohamed Mitwalli 3-Sep-12 6:22am    
5+
__TR__ 3-Sep-12 6:40am    
Thanks Mohamed.
Manas Bhardwaj 3-Sep-12 6:22am    
5+
Hi ,
Check this http://www.connectionstrings.com/sql-server-2008[^]

You can use it like
if your connection in web.config
HTML
   <connectionstrings>
 <add name="testConnectionString" connectionstring="Data Source=PC\SQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=123">
  providerName="System.Data.SqlClient" />
</add></connectionstrings>

C#
 string conn =  ConfigurationManager.ConnectionStrings["testConnectionString"].ConnectionString;
        using (SqlConnection con = new SqlConnection(conn))
        {
            con.Open();
        }

or
   using (SqlConnection con = new SqlConnection(@"Data Source=PC\SQLEXPRESS;Initial Catalog=test;Persist Security Info=True;User ID=sa;Password=123"))
        {
            con.Open();
         }


Best Regards
M.Mitwalli
 
Share this answer
 
Comments
__TR__ 3-Sep-12 6:10am    
My 5!
Mohamed Mitwalli 3-Sep-12 6:21am    
Thanks TR :)
Manas Bhardwaj 3-Sep-12 6:22am    
yup 5+
Mohamed Mitwalli 3-Sep-12 6:28am    
Thanks Manas
Prasad_Kulkarni 3-Sep-12 7:09am    
5'ed
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900