views:

149

answers:

3

Hello Friends,

I have developed a desktop application using C# as frontend and SQL as backend. But one of my client wants to buy it if the software is able to operate from multiple computers and a common database must be placed on one main computer (server).

Hence I wanted to know,

If the already developed application can be configured as client/server application making some minor changes OR should I completely develop a new application.

Secondly, how can I develop a client/server application (any hints or website links would be sufficient).

Thank you in advance.

+1  A: 

It depends upon how you connect to the database. As from your post, it seems the application is ready to run off a single database from multiple computers. The database connection string need to be provided properly. Properly means that you should be able to connect to the database on a particular machine from all of the machines where you wish to run your application.

Kangkan
Hi Kangkan,Thanks for the reply.My application is ready to run on a single computer, where SQL database is saved in the Application Startup folder.But I am completely unaware how to configure the database such that it is accessible from multiple computers
Niraj Doshi
@user395500: What do you mean by SQL database saved in Application startup folder. Are you using sqlite? What database connection string have you used?
JPReddy
@user395500: Do you mean the mdf file being stored in the application startup folder by this? I shall suggest to keep it on a standard location like the default data folder for SQL server and then access it.
Kangkan
DataSource=MyPCName\SQLEXPRESS;Initial Catalog=XPRESS,Integrated Security=True;Pooling=FalseThis is the string I use with my application..Now what sould be the conn-strings for Server and Client ?
Niraj Doshi
Yes Kangkan, My .mdf file is saved in Applcation Startup Folder.
Niraj Doshi
Keep it on a standard location like the default data folder for SQL server and then access it.
Kangkan
@user395500: You do one thing. Transfer your database from your machine to some other machine in your network where SQL server is installed. Now change your connection string to DataSource=[otherPCName]\SQLEXPRESS;Initial Catalog=XPRESS,Integrated Security=True;Pooling=False. This will become your client/server application.
JPReddy
Thanks guys your replies proved very useful. :)One final question: Do I need to make any TCP/IP or Network settings ?Thanks again guys.
Niraj Doshi
As far as application is concerned - NO. For other things your system administrator should help you, for things like installing sql server on a central machine and allowing other users in the network to access the database etc.
JPReddy
@JayaprakashReddy: You are right. For deployment, one should take help of the sys-admin. What I was suggesting him is during the development and testing, where one might have more control on how s/he installs the server and all. From the post, it was seemed to have a environment of doing things as wished by the developer. Otherwise, the problem would not have occured at first place.
Kangkan
@JayprakashReddy and @Kangkan : Thanks a lot guys... it was indeed helpful. God bless you. :)
Niraj Doshi
A: 

Although seems your applications already can work with common DB, I would suggest you to have service layer. You can develop service layer with WCF which will deal with DB and your clients will work with that service layer. So it will be kind of n-tier application. I think this will require less modification as you have already developed presentation part (desktop application) and also some of Data Layer.

You need something like this : alt text

Incognito
-1... while I am a big fan of a middle layer.... this is an existing application. Rearhcitecting for this is really overkill. A layer should have been there from the start, but it is not.
TomTom
From his requirement it doesn't look like it requires any web service as such. A database central server and client installed on different machines with connection string pointing the central DB machine.
JPReddy
@TomTom, JayaprakashReddy I have mentioned that application already can meet the requirements, but I suggest to change the architecture as I believe that later modifications will be much painless with new architecture. Are there any objective comments besides that each have his own taste what to use?
Incognito
Yes. An UNNNEEDED architecture CHANGE is simply stupid at that point. I fully agree it is nice to have - especially for alter versions- but this is not the question here. THe question is how to get THIS one WORKING. As in "Now".
TomTom
@TomTom yea of course it is very unneeded to have flexible solution and modifiy the whole code when some modification will be needed. Of course lets forget about flexibility and always provide local solutions to each task.
@Incognito I think the architecture in the image is a little complicated for the solution required. The simple presentation->service->data must be enough.
@TomTom again it it your SUBJECTIVE opinion. As for me I would provide the proper solution as I really believe that the solution which can't be extended/modified is evil and at some point it can become headache. And also please the question once more, the guy is asking "Secondly, how can I develop a client/server application". Anyway son't see any point to continue this kind of discussion as don't see any point in it.
Incognito
@MigNix Yes may be it is a little complicated, but the point is just to show the idea.
Incognito
A: 

You can do that with some changes on both client side and server side (Sql).

You can install your SQL server on a machine and point your application to that machine to access database. You can then install your application (Client side) on n number of machines and access the central database.

If n number of users updating the database at the same time then you need to handle concurrent update transactions as well as reading the data at the time of update.

On the client side you should have multi user handling facility. Where multiple users can access the client side system with different logins on different machines and even database should facilitate that user role mechanism. if your system doesn't require any user roles in the system and anybody can access that application, then this change is also not required.

Based on your requirement I can say that this is not much complex client server application. So getting basic idea on client server application is enough. This you can find it by googling.

JPReddy