0
Answer

attach database to my setup in C#

Varij Kapil

Varij Kapil

11y
1.4k
1
hello all

i am new to C# programming.
i have developed a software that uses MS SQL Server for database connectivity.
my project is completed.
now i have to create a setup of it and submit it.
i know how to create a setup but what i dont know is how to attach my database with it so that when someone installs my software the database is automatically created on his system.
and then use the connection string which is already defined in the  program to connect to the database.the connection string takes server name as input from the user and the catalog is predefined in it.
need a solution that can cope up with this requirements.

i have surfed a lot of articles and forums and tried different things.
but all gave an error somehow.
tried to create a new database but didn't work out with my existing code.

tried to attach .mdf file to my solution but VS2010 gives error attaching the file.

pretty helpless now.

any help would be appreciated.
thanks in advance