make a global connection between database and windows app

JustinFojas

New member
Joined
Oct 1, 2008
Messages
1
Programming Experience
Beginner
I made a windows app connecting to a database but when i submitted my homework to my prof he said that the database is not connecting but the program runs. i am thinkingg there is something wrong with my app config because i used the wizard connect to the database.

so my question is.. is there a way to make the connection string work on any computer because the database it will be using is copied in the folder where the solution and program is.

HTML:
  <connectionStrings>
        <add name="WindowsApplication1.My.MySettings.NORTHWNDConnectionString"
            connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;Connect Timeout=30;User Instance=True"
            providerName="System.Data.SqlClient" />
    </connectionStrings>

thanks
 
You would need to detail more what exactly the error is. I'm assuming though it is not finding the data file to attach to the database.
 
can you make some clarification regarding your problem.

why not setting your data source path on data file of your project
 

Latest posts

Back
Top