PDA

Click to See Complete Forum and Search --> : Developing an instalation file in VB2008


indijaner
Dec 17th, 2009, 02:45 PM
I need to integrate Database into my project. I found some help:
properties of the project:
references, add, existing item, choose DB mdf & ldf
properties of the form:
build action-content
copy to output directory-copy always

data source=.......attachDbFileame=DataDirectory\.....

But when I click on Add, it doesn't give an option for existing item.

Please, help.

p.s. I use VB2008 Express and MS SQL Server 2005

gep13
Dec 17th, 2009, 03:46 PM
Hey,

Are you actually right clicking on your project and then references?

If so, this isn't quite right, simply right click on your project, then choose Add | Existing Item...

Then follow the rest of your steps.

Gary

indijaner
Dec 17th, 2009, 05:21 PM
Thanks, Gary.

I did all this, but I still got this error:
http://img695.imageshack.us/img695/1897/clipboard01111.jpg

Do I need to do something else? Or I did something wrong?

gep13
Dec 18th, 2009, 01:32 AM
Hey,

Have you confirmed that the database exists at that location?

Or, does another database with the same name already exist in the SQL Server instance?

Gary

indijaner
Dec 18th, 2009, 08:42 AM
I moved a database. That is the point. I want to install this program on another computer with integrated database. Can I do that?

gep13
Dec 18th, 2009, 08:45 AM
Hey,

In order to use an mdf file though, you need to have an instance of SQL Server to connect it to. Do the other computer that you are running the application on have SQL Server installed? If so, it is likely that you will need to change the connection string to include the new server name.

If you are looking for your application to be truly portable, you might want to think about storing your data in a SQL Server Compact Database. This doesn't require an instance of SQL Server in order to operate.

Gary

indijaner
Dec 18th, 2009, 08:52 AM
OK, thanks. I'll try that.

gep13
Dec 19th, 2009, 07:42 AM
Hey,

How did you get on with this? Are you getting any further?

Gary