client machine name and connection string

rockyy

Active member
Joined
Feb 3, 2010
Messages
25
Programming Experience
Beginner
Vb.net and sql server help…?
My application (exe) is made
Using .net (vb.net)
And Backend-sql sever
After making it into package and my client install it into his pc
See pic here-\ the computer name I m talking about
dzc6k6.jpg

Suppose my client machine name is-hcl
And I already made all connections string with hcl\\sqlexpress using windows authentication in app.config
And after sometime he formats his pc and changed his pc name to= hcl-2 ??
Now the problem
Is there any way to get the new system name ???? to make connections
bcuz its not worth it to always making a new exe and giving it to him when he formats his pc???
 
ya exactly i want to grab the machine code everytime when it newly generated or formatted but i don't know the method how to do it can u explain it thanx
 
Well your program is not going to have anyway of knowing if the hard drive is new or just formatted so your program will grab the computer name every time it is run.

To do that you can use:
VB.NET:
Expand Collapse Copy
 Dim strMachineName As String = My.Computer.Name
And user strMachineName with your connection string.
 
Your connectionstring is stored in your xml config file

Just edit the file - that's why conn string is put in a config file in the first place!
 
Your connectionstring is stored in your xml config file

Just edit the file - that's why conn string is put in a config file in the first place!

this already exist in my project file what modification should i made to it ..????

VB.NET:
Expand Collapse Copy
 <add name="WindowsApplication5.My.MySettings.llConnectionString"
      connectionString="Data Source=cjard\SQLEXPRESS;Initial Catalog=cjardl;Integrated Security=True"
      providerName="System.Data.SqlClient" /

should i add again one more parameter <add name="" connection string=""
i m confused
 
Back
Top