ds2r 0 Light Poster

Good day everyone!
I'm still a noob with C#.NET so patience pls! :)

I'm making a Windows Forms Application with a database from MS SQL 2005 Express.
I want to transfer this projects with the database to another pc.
What should I do? Should I transfer the database (.mdf and the log) from the MS SQL folder along with the project?

I have this connection string inside the application

@"Data Source="+Environment.MachineName+"\\SQLEXPRESS;Initial Catalog=BFootwear;Integrated Security=True;";

I made the Environment.MachineName to get the datasource automatically. This was also automatically generated and I copy pasted it from the properties of the database in the server explorer.

I also have a dataset in my application. Will it be affected?

I tried it but I had i-cant-understand-why results. The connection string from the properties in the server explorer changed to

Data Source=.\SQLEXPRESS;AttachDbFilename="xxx";Integrated Security=True;Connect Timeout=30;User Instance=True

where the xxx is the directory of the database.

Then when i compiled it, it doesn't connect anymore.

Any help would be appreciated.

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.