hi,
i have a project written in visual studio 2008. and i copied the folder to the network drive. and from another pc when i run the exe file of the application an error occurs because the connection string is different, how can i make the application which is in the network drive to access the mdf file in another computer(where the application was created)

how can i change the connection string so that it can access the original mdf file???

can some one give me some guidelines
thaxx

appreciate a lot

thaanxxxx

Move the connection string out of your code into Application settings

hey
i am JusithSampathwa in a different login

the connection string is already added to the setting

You have to manualy write the full path to the YourDB.mdf file.
So repair the path in theconnection string.

You have to manualy write the full path to the YourDB.mdf file.
So repair the path in theconnection string.

it is the full path from the c drive of the computer,
what should i change more than that

Is the conn. string written like that:

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\myFolder\test01DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"

C:\myFolder represents the full path!

Is the conn. string written like that:

connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=C:\myFolder\test01DB.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True"

C:\myFolder represents the full path!

het in windows login you have to ad the windoes login user to the sql server,
then i could login to the sql server and the projects works fine

but in sql server authentication i coudn't make it
can't connect it that way
why is that

This connection string was only an example Please take a look at your own string. I dont know what it like.

Mitja Bonca you are great. hats off. to you

Simple Buddy...

Just Use SQL SERVER Configuration Manager & Have TCP IP Enabled For The Server Instance , Then Open INCOMING For The Port 1433 Or Any Other The Port You Selected In The Manager Using Windows Firewall.

Then The Connection String : server=10.20.30.40,1433;database=myb;user=sa;pwd=***

Use This In All Your PCs Networked . No More need of copying the mdf file, just the exe file.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.