Click here to Skip to main content
15,888,263 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
suppose I am the database and one c# or vb.net developer wants to connect my database
using Oledb.
so he would write
oledbConnection con=new Oledbconnection();
con.connectingstring =d:\mydb.dfv;

Now upto this coding i have done . one could write this much of code in c# and connect to my database.

now if someone sitting on different computer in LAN or MAN and wants to connect my database what will be the code on my side (i am the database )

What I have tried:

not very sure about the coding
Posted
Updated 13-Feb-21 23:39pm

The DB isn;t in control of what the user needs to enter as the connection string: he needs to identify the computer, the type and version of engine that can open the file, the share the file is under, the path from that share to the actual file, and some security information to allow him to access your computer to do that.

The later bits are the difficult ones: you need to ensure that the file is available, and that his user details will allow him access - and we can't even begin to check that!
It is unlikely that holding the file in the root of any drive is going to be a good idea: security on root folders is tight, and getting tighter - so what works today, probably won't work tomorrow!

Plus, two other things:
1) I have no idea what a DFV file is, or what kind of engine would open it - it's not a familiar extension - so you will probably need to provide engine files / installer before any other user can access it.
2) Multi-user access to database files directly is always a poor idea - it leads to a lot of hard to pin down (and harder to fix!) problems once it gets out into production. I would strongly recommend that a multiuser DB system such as MS Sql or MySql is used instead.
 
Share this answer
 
Comments
Member 12712527 14-Feb-21 4:03am    
sir DFV File is the database file created by the user when he uses my database to create a table
would the connecting string be like this
con.connectingstring ="https://www.apple.com/d://mydb.dfv"
Or
Different
OriginalGriff 14-Feb-21 5:34am    
Different.
Trust me on this.

You cannot access files on your computer via apple.com.
Or any other domain, probably.

Eating an apple probably won't help either, though it's good for you (unless you are allergic to apples of course).
Member 12712527 14-Feb-21 5:46am    
then how come could i access file
Member 12712527 14-Feb-21 4:10am    
i am just sighting an example -- www.apple.com
OriginalGriff 14-Feb-21 5:52am    
At this point, I'm going to walk away from this discussion, because I'm having increasing difficulty in not being rude to you - or at least explaining things to you that you will assume are me being rude.

I don't want that, so I'm going to stop before it happens.
All of your questions relate to the same thing which you still do not seem to understand. You were told yesterday how a client can connect via a network using sockets and TCP/IP. It is your job to write the code that manages that connection. So you need a client application which the user will install on their system, and a server application which will run on the database server.

The user should only need to know the IP address, or network name, of the database server, and the name of the database file. The driver software (all of which you will write) will create the connection and manage the transfer of data in response to the client's requests.
 
Share this answer
 
Comments
Member 12712527 14-Feb-21 5:52am    
sir sorry believe me i don't know client server architecture
Richard MacCutchan 14-Feb-21 6:12am    
Then you should forget this whole idea (whatever it is). Unless you have a good solid understanding of client server and network protocols you will never make any progress.
Member 12712527 14-Feb-21 6:22am    
thank you sir my further questions will be on this only
Richard MacCutchan 14-Feb-21 6:32am    
You are wasting your time posting these questions here. This forum is for helping people with actual code that they have written. But your questions are on research into a number of subjects. So you need to start doing the research and find articles and tutorials on the subjects I have mentioned, and actually learn how these things work. it is impossible in a forum like this to provide anywhere near the detail that you are asking for.
Member 12712527 14-Feb-21 6:43am    
sir sir sir i am a shop keeper and you say i am researching !!!!
i have interest about this application c#
what do you think of me

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