Hey
I finally made my first "serious" application that will be distributed to a user. But since this is the first application that uses a SQL database, I know that the application will not be able to connect to the server (since I was using a local server on my computer), but I don't know how to solve this problem, so can you please help me with this. Is it possible to configure the users computer to work with the existing code (I have the permission to do that), or will I have to change the code of my application to fit the users computer. Also what software (like SQL server and Framework) does the user computer has to have to support this application.
Thanks
Loading
Sam HobbsPosted Dec 19, 2011, 1:46 PM
The most typical solution is to put the connection string in a property/setting. .Net has classes for reading and writing properties. You can use the existing classes and IDE designer to manage connection strings and that will minimize the amoutn of work you do. Note that there is a difference between properties for your project and the properties for the applicaion. The project properties are used by Visual Studio to manage the project. The application properties are used by your application during execution of the application.
Look in the properties for your project; you will see a "Settings" tab. In the settings tab is a table showing the settings for the project. For each setting there is a Type; one type that you can use is Connection String. The settings are stored in a special XML file. I have described the settings page more extensively in a few other threads.
If you put the connection string in a setting, then the VS IDE can generate a setup that allows the connection string in the settings to be modified when the application is installed. I hope that the articles in this web site provide all the information you need to do that.
Sam HobbsPosted Dec 20, 2011, 2:01 PM
- View database structure using C#
- Login failed for user 'hp-PC\hp'
- query string for C#/sql
You can do a search like this for more answers.Pravin GhadgePosted Dec 20, 2011, 5:20 AM
Can u provide me some links to include connection string in Properties Tab & access them in connection class
Neven DraskovicPosted Dec 20, 2011, 5:08 AM
I want to thank you all for helping me, I appreciate it.
Sam HobbsPosted Dec 20, 2011, 5:03 AM
Pravin GhadgePosted Dec 20, 2011, 4:52 AM
Do some setting in sql server 2008:
1)Go To Start->All programs
2)Microsoft Sql server 2008
3)Configuration tools
4)Sql server configuration manager.
5)In Sql server 2008 Services->Click on Sql Server Express.
6)Right click on it ->Go to properties->Select Local System as Built in Account.
7)Click on Restart button
8)Apply & OK
Neven DraskovicPosted Dec 20, 2011, 4:45 AM
Pravin GhadgePosted Dec 20, 2011, 4:34 AM
What version of sql server u had installed.
Neven DraskovicPosted Dec 20, 2011, 4:32 AM
Pravin GhadgePosted Dec 19, 2011, 12:21 PM
can u show me how u r writing ur connection string.
Neven DraskovicPosted Dec 19, 2011, 8:29 AM
Pravin GhadgePosted Dec 19, 2011, 7:25 AM
1)To support ur application to run on any server without changing ur code.
u can keep ur connection string in notepad & access in application.
So u dont have to change ur code as per the server name.
2)Software needed for user computers are:
a).net framework
b)Sql server
c)crRedist2005 (For supporting crystal report).
If u have any other queries Plz reply