I have problem in ConnectionString in windows Application

Posted by Nuwan under C# on 4/16/2012 | Points: 10 | Views : 2533 | Status : [Member] | Replies : 10
Dear All,

I have develop a windows base Application in C#.net with Sql Database, & I Create a Setup using Visual Studio.
Now i install that setup in another machine, I faced a problem in Sqlconnection String. I put a connection string in class.
How to put a connection string in dynamically/

how i solve it. Please help me..

thank you......

Rathnayake


Responses

Posted by: Gow.Net on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
please try that application in SQLAuthentication

gowthaman8870226416

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

Posted by: Gow.Net on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
Activate Remote connection in that system
refer this link
http://www.linglom.com/2007/08/31/enable-remote-connection-to-sql-server-2005-express/
http://www.linglom.com/2007/08/31/enable-remote-connection-to-sql-server-2005-express/


gowthaman8870226416

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

Posted by: Kk86kiran on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
can u tell me what did u write in your connection string class

k.m.j.kiran

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

Posted by: Nuwan on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
class DbConnection
{
public readonly string conn_str = "Data Source=nuwan-pc\\sqlexpress;Initial Catalog=CRM;Integrated Security=True";


}

problem is this work perfect in my own machine. after creating setup I install it another my friends machine not working in application.

Rathnayake

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

Posted by: Kk86kiran on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
in ur friend machine which version of sql is used?

k.m.j.kiran

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

Posted by: Nuwan on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
Sql 2005, Bt I debugging my Application build in setup project. in that application my server name & Friend machine server name are different. I cant change it dynamically in setup project.

Rathnayake

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

Posted by: Kk86kiran on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
If u have complete code then change ur connection string as data source =. or localhost

k.m.j.kiran

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

Posted by: Kk86kiran on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
then agin build ur setup and use in other system

k.m.j.kiran

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

Posted by: Nuwan on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
its ok, But problem i install it 100 machine want to create a 100 different setup.
I want to create this work easy.
If you can give me a idea...

Rathnayake

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

Posted by: Kk86kiran on: 4/16/2012 [Member] Starter | Points: 25

Up
0
Down
i think if create ur solution with local host or . it will useful for every system becoz local host or . means the same system(what ever the system u used for installation).

other wise let me search for solution

k.m.j.kiran

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

Login to post response