473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

visual c# project .exe and database problem

hallo everyone,

I have created a project in visual c# and a database with access 2007 .accdb. Now if i want to run the executable file (i mean .exe) in the bin should i also carry the database, if so will it connect to the database automatically or even if the create a DSN and when i run the .exe in the another computer the database connection string will differ. so what can be done ?.. any idea ?... help me please if anyone knows how to do it ..

Thank you,
Dinesh.
Dec 3 '08 #1
5 3579
Curtis Rutland
3,256 Expert 2GB
It depends on how you connected to your database in your program...

Did you use an absolute path? The better way is to use one of the application variables that hold the path information.

If this is a Forms app, you can get the startup directory by using Application.StartupPath. Or you can get the app data path by using Application.UserAppDataPath.

What you should consider doing is adding an installer project to the solution, and adding both the project output and the database file. Have them both installed to the same directory, and use the Application.StartupPath to help build your connection string.
Dec 3 '08 #2
Ramk
61
@insertAlias
You can also use App.config file to hold the connection string information.
You can define it <Connectionstring> entry in it.
Dec 7 '08 #3
hello insertalias,

Its a form application, can u tell how can create a installer project ?...

Thank you.

Regards,
Dinesh.
@insertAlias
Jan 17 '09 #4
Curtis Rutland
3,256 Expert 2GB
If you are using the full version of Visual Studio (not Express) then one of the project types (under "Other Project Types -> Setup and Deployment") is a Setup Project. Add one of these projects to your current solution. You should be able to find some tutorials on the web on how to use this project type.
Jan 17 '09 #5
hello insertalias,

i found how to create a installer project but should i create a application folder installer project and then add the database file to the folder and set the connection string as application.startuppath or application.userappdatapath to get the database work with the application ?. IS it enough if the add the database file by right clicking the application folder and click add and the click and file and add the database file ?...

Thank you.

regards,
Dinesh.

@insertAlias
Jan 17 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Job Lot | last post by:
I am having loads of problem using vb.net project under visual source safe. I’ll start with How can I exclude source safe information from the project when I take a copy of project home? I...
63
by: Jerome | last post by:
Hi, I'm a bit confused ... when would I rather write an database application using MS Access and Visual Basic and when (and why) would I rather write it using Visual Studio .Net? Is it as easy...
1
by: Mike | last post by:
Hello, I hope there is a solution to this. I am required to develop a service application using Visual Studio ..NET. I am required to develop it using C++. Originally we set out using...
0
by: dave | last post by:
I have used Copy Project in Visual Studio.Net 2003 to make a copy of a project on which I want to base a very similar project. The project uses a back-end SQL Server database and has a lot of...
4
by: junaidnaseer | last post by:
Hi ! I am facing a problem that I have defined a function which when called in the same file generates an error as follows; " visual c error C2371 redefinition basic types see...
18
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft...
0
by: russell.mccloy | last post by:
Hello, I started using the new CTP for Microsoft Visual Studio for Database proffessionals and it's great. however I decided to do a walkthrough on a web cast and follow the steps. When I go...
1
by: bharathreddy | last post by:
This Article gives an introduction to VSTS Team Foundation & fundamental difference between Visual Source Safe (VSS) and VSTS Team Foundation. Team Foundation is a set of tools and technologies...
1
by: Ronm | last post by:
Hey Guys, I have a problem which has been driving me crazy for the last days. I'm working on a small project involving: Visual Basic Acces Database ASP and adobe/macromedia Flash,
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.