Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
hi

I have a web application and desktop application both written by C#, using visual studio. my question is how to connect these both applications with the same database ?

please give my any reference or steps because I'm not propositional I'm beginner.

Thanks

[update by op]
My project about Voting System by using finger print but because i cant connect the fingerprint device with the web application i decided to make it in desktop application and the (voters, candidates) can register in the web application. I using SQL Server 2008 express R2 and i already built the database for the web application. I will create other database in desktop application to storing the fingerprints. So what can I do? can I create other data base for storing the fingerprint in desktop application and connect it with the web application's database? or what ?
Posted
Updated 4-May-13 6:37am
v2
Comments
Zoltán Zörgő 4-May-13 6:32am    
Well, this question is quite interesting, because I can not figure out what do you mean. Ok, I understand your sentences, but this really simple: do it! If you can connect each of them, you can connect both. Can't you?
But as your question makes so little sense, I have the feeling, you have deeper level problems. So before anyone can answer to you, please add more details to your question, like:
- is any of them using the database currently?
- what kind of database (like SQL Server 2008 or something, or Access file, or DBF files, or what)?
- will both applications run on the same network (do they both have direct access to the database service)?
- or do you want to access the database with a desktop application that needs to connect via internet for example?
And there are many others you could add, depending on these for example...

So be kind, and let improve your question, since we can not read your mind.
Sandeep Mewara 4-May-13 6:59am    
+5
Zoltán Zörgő 4-May-13 12:45pm    
A question to your update (a question I have already posed):
In general a web application is accessing a database from server side, thus in general those are near each other (when not on the same machine). And to have full feature set of the web application you have to reach only the web server from your client, not the database server. But a desktop application (if no other interim tire is there) will need to access the database server. But there can be tens of firewalls between them, and not possibility to have TCP level data exchange between the client and the database server. So please answer: the clients will be on the same network with the database server or they are far from each other (from networking point of view)? Because if the client will have the same possibility to access the database server as the web server has, your task is really simple and you have to consider only the authentication and authorization issues.
With other words: where are the clients:
A) anywhere on the Globus
or
B) in a corporate or campus kind of network together with the database server?

1 solution

If you want to have multiple applications using the same DB then all you need is to ensure that you access the DB via a multiuser server DB system - Sql Server or MySql for example. It insulates you from the actual file and handles all the multiuser access stuff for you.

So set your DB up on an SQL Server instance that both your Desktop machines and the server hosting your web app can access and you should be fine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900