Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am an armature C# programmer. I am developing a database application. Can anybody help me with the code on how to locate and connect to sql server database on a network and save it. so that subsequently the connection will remain and the user can connect without passing through the process of connecting again.

thank you

Please can send the code to me [Email address removed]
Posted
Updated 5-Jun-13 6:13am
v2
Comments
Thomas Daniels 5-Jun-13 12:14pm    
Never post your email address, if you don't like spam!
Read here why: http://ask-leo.com/why_shouldnt_i_post_my_email_address_in_a_public_forum.html
You should have the connection credentials like username, password, so that you can connect that machine through its IP or computer name. That depends upon the computer which is serving this DataBase. Use those connection credentials and build a connection string and then connect using the SqlConnection Class.

So, what is the problem ?
Volynsky Alex 5-Jun-13 18:39pm    
How to connect database over local area network SQL Server 2008:
http://stackoverflow.com/questions/6667400/how-to-connect-database-over-local-area-network-sql-server-2008

Regards,
Alex.

Hello,

I think this CodeProject article is right for you and should get you started.

Regards,
 
Share this answer
 
Comments
Maciej Los 5-Jun-13 16:26pm    
Good link. My 5!
Start here: ADO.NET (msdn)[^] and read all related articles ;) then have a look at ADO.NET Code examples[^]

In case of problem in connection string: http://www.connectionstrings.com/[^]
 
Share this answer
 
Comments
Prasad Khandekar 5-Jun-13 16:35pm    
Thank's for providing alternate links as well. Especially connectionstrings.com it's worth mentioning.
Maciej Los 5-Jun-13 16:36pm    
Thank you, Prasad Khandekar ;)
 
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