Database connectivity

Posted by Malwazcrazy under C# on 4/2/2009 | Views : 1325 | Status : [Member] | Replies : 5
Hi m facing a problem currently while making a connection to database. I m using VS.NET 2005 and SQL 2005. During connection it asks for computer name and database server name. Doing so will make my application run only in my computer coz whenevr computer name or server name gets change it wont work. Is there any other way to solve this problem. If yes and possible than plz send me the code snippet. THANK YOU and waiting for ur reply. Thanks again.




Responses

Posted by: Sagarp on: 1/25/2010 [Member] Bronze

Up
0
Down
send me ur code

Thanks
SagarP
http://www.emanonsolutions.net
http://emanonsolutions.blogspot.com/

Malwazcrazy, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 4/2/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Malwazcrazy

In an Application you have to store your Connection to your database in a connectionstring. Now if the Database name changes then you only edit the web.config.

http://www.codeproject.com/KB/tips/StoringConstring.aspx

Thank you for posting in .NETFUNDA

We are looking forward for your reply

Vuyiswa Maseko

Thank you for posting at Dotnetfunda
[Administrator]

Malwazcrazy, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 4/2/2009 [Member] Bronze

Up
0
Down
You can use .(dot) or (local) as your server name

Malwazcrazy, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 4/2/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Neeks if he uses (local) dont you think it does not solve his problem ?
because if the server name changes he will still suffer.

Thank you for posting at Dotnetfunda
[Administrator]

Malwazcrazy, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Neeks on: 4/2/2009 [Member] Bronze

Up
0
Down
I think there won't be any problem

Malwazcrazy, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response