C#

Moderators: None (Apply to moderate this forum)
Number of threads: 2722
Number of posts: 5749

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
C# and SQL Deployment Issue Posted by Isip2 on 9 Aug 2009 at 6:26 AM
Hi!

I am new to programming with SQL so I really need help on this one. After I finish an application with no errors or bugs, i tried to launch it in different computers. However, most computers encouter SQL errors while loading the application, either a timeout error or the application simply crashes due to the inability to load the data from an SQL database.

My questions are the following:

1. Do you need an SQL server running in the computer where you will deploy the application? Though in some computers, the application worked even though they do not have an SQL Server.

2. Should I modify something in the connection string when I am already deploying the software? Is there a difference in the connection string when the program is running in my computer and in other computers?

My connection string is this:
"Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\MyDatabase.mdf;Integrated Security=True;User Instance=True";

I tried modifying the timeout but the error still remains.


3. Where could I have missed something?

Sorry if I am missing something trivial here.

Thanks in advance for those who will respond! You'll really be helping me a lot.

Thanx!
Report
Re: C# and SQL Deployment Issue Posted by DataDink on 10 Aug 2009 at 2:35 PM
So in your "development environment" you are simply connecting to a database file. The point of a production database would be that everyone is reading and writing from the same information. If you just pass around a database file to everyone, then each of them will have their own copy of the information in that database, and when one makes an update - no one else will see it.

What you want to do is set up an actual SQL server with your database structure in it. Then, yes, you would change your deployed/production connection string to point to it.

So you will want to look up setting up an SQL server (or you might want to switch to MySql since it's free) AND you will want to look up how to connect to that instead of a database file.

If you are having trouble with connection strings at any point a really awesome resource is at www.connectionstrings.com.
Report
Re: C# and SQL Deployment Issue Posted by Isip2 on 11 Aug 2009 at 5:06 PM
Actually, my really did not intend to have a central database for my application. I intended everyone that has my application to have their own database- thus a database file. So technically, my application is a desktop application with each user populating his own databse.

However, i think i should have used a local database or an access database from the start for this purpose, but I already finished the application and I used a service-based SQL database. Is there any way to somehow let my database act as a local database and not like a database server? Sorry if my question is vague, or meaningless at worst, I am really new to SQL programming.

Thanx for the help!



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.