Hi guys, I’m making a Windows Forms application for a company. It needs database management and that kind of things, so I decided that I was going to use Entity Framework based on an SQL database.
The thing is, that I don’t know how could it be possible to connect multiple computers to the same database. It is such a small company, that they don’t have internet, so I don’t know how could I achieve this. I thought about having the database file saved in computer A, and computer B and C should connect to it, even through usb cables. I don’t know if this is the best practice, and if it is, how could I do it?
Make sure that the SQL server on a machine is accessible from all computers you intent the app to work. You also may have to open ports used by the SQL server in the firewall. You can then update the connection string to connect to the SQL instance.
First of all you have to change localhost with the host name or with the ip of the sql server hosting pc. then you have to enable tcp/ip on the sql server Configuration Manager on the hosting pc then go to SQL Server Network Configuration and click on Protocols for SQLEXPRESS. Then you will see that TCP/IP is disabled. Double Click on TCP/IP and select yes to enabled.
I thought about having the database file saved in computer A, and computer B and C should connect to it, even through usb cables. I don’t know if this is the best practice, and if it is, how could I do it?
Sorry, you're wrong.
You need only one database installed on a single computer (let it be computer A). You have to install an SQL server on it and enable remote connections to that SQL server instance. Other computers (B-Z) have to have intalled an application, which connection string refers to SQL server instance on computer A. I'd suggest to get connection string from config file. See: Connection Strings and Configuration Files | Microsoft Docs
For further details, please see Richard's MacCutchan Deeming answer.
I need a efficient , verbose and efficient analytical tool which I want to integrate in my application. The requirement or expectations are -
1. Online feedback.
2. Provide a more in-depth version of the quick start guide, with section headings acting as individual articles.
3. Product Tour for New Users.
Also to add my application is designed purely in .NET framework using MVC (may integrate to .NET core in future). So suggest something which is compatible to the technology stack as well.
I have two tables, Violations and NOVs, NovId is Foreign Key in Violations table, because it was OneToMany, but later when we needed ManyToMany relationships between these two tables, we created ManyToMany table where we transferred the association over there, how this new ManyToMany table is designed is, columns PKManyToMany, ParentTable, ChildTable, ParentId, ChildId, for NOVs and Violations relationships, ParentTable='Notice', ChildTable='Violations', earlier there was Linq Query as below:
UnitOfWork.ViolationRepository.GetAll() gets all the Violations, but the new relationship is not directly to the NOVs table but ManyToMany table ParentTable='Notice', ChildTable='Violations', how can I include those records and then include the NOV table then include the NOV.CitedPartyData table, can we specify Include with condition and if the explicit foreign key is not created between table in the database, can Include still bring the records for the conditions.
I found that another big concern that I have is UnitOfWork.ViolationRepository doesn't have the ManyToMany table link (maybe Foreign Key), still can I use it in Include to load it or if I have to use UnitOfWork.OneToManyRepository, how can I use it?
- any help would be very very helful - thank you so much please.
How can I include or return the Tables and relationships and related Data like with Include statement of Entity Framework, when the Tables don't have Foreign Key relationships? I mean Include loads if the Tables have Foreign Key relationships, but if the Tables don't have FK relationships, can we load the structure similar way? If we can, can you please guide me something - thank you.
Last Visit: 23-Feb-20 16:53 Last Update: 23-Feb-20 16:53