|
Thanks to all of you guys - I resolved it and your suggestions also helped me, I was just out of my mind - I shouldn't have put this question - just too much of stress as some release is happening.
Thanks for understanding
|
|
|
|
|
It really helps other people if, when you resolve something, you actually show your solution.
|
|
|
|
|
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?
|
|
|
|
|
You install SQL Server on one computer, and create the database there.
All other computers that need to use your database will need to be able to connect to the SQL Server computer, so you'll need to enable remote connections, and possibly add an exception to the Windows firewall.
How to configure SQL Server 2005 to allow remote connections[^]
You configure your application's connection string to point to the single SQL Server instance, and the computers will all be using the same database.
SQL Server connection strings - ConnectionStrings.com[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
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.
|
|
|
|
|
Quote: 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.
[EDIT]
Sorry, Richard.
modified 3-Dec-19 9:21am.
|
|
|
|
|
Maciej Los wrote: For further details, please see Richard's MacCutchan answer.
Really? I know I had a birthday recently, but RMC's still got a few years on me.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Oooops!
I owe you a box of good polish
|
|
|
|
|
Maciej Los wrote: good polish
Any recommendations beyond Zywiec Porter? It's been a few years since my last visit.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Sounds like you are a fan of dark beer...
Yes, there's few other brands, like: Okocim, Łomża and few less known companies (small, local breweries).
Cheers!
Maciej
modified 3-Dec-19 9:45am.
|
|
|
|
|
Thanks - I'll keep an eye out for them. Although I might avoid the piwo bezalkoholowe version.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thank you, apology accepted. But it was nice being an SQL expert for a while.
|
|
|
|
|
Nobody has mentioned it yet, but networking through USB cables isn't going to work.
Use Ethernet or your network doesn't happen in a supportable way.
|
|
|
|
|
|
When I use the connection string ‘\\\\network\share\file.db’ it works fine. But if the share is hidden the SQLite database can not be found.
I use the connectionstring as follows:
Con As New SQLite.SQLiteConnection With {.ConnectionString = "Data Source=\\\\network\share\file.db;Version=3;"}
The \\\\ is according this article: unable to open database file on a local network
|
|
|
|
|
If the user running the code doesn't have read and write permissions to share and to the folder the database is in, it's not going to open.
There is no such thing as a "hidden"(*) share. You either have permissions to use it or you don't.
* There are admin shares, where the name ends in a $, but you need admin permissions to see them. Normal users will never know they exist.
|
|
|
|
|
@"\\network\share\file.db"
or
"\\\\network\\share\\file.db"
..but what Mish answered, won't work
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
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.
Thanks
|
|
|
|
|
What have you found in Google? Which ones have you looked at, and which ones have you rejected?
|
|
|
|
|
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:
var Violations = UnitOfWork.ViolationRepository.GetAll()
.Include("NOV")
.Include("NOV.CitedPartyData")
.Where(i => i.InspectionItemId == inspectionItemId)
.OrderBy(i => i.ViolationId).ToList();
return Violations;
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.
modified 20-Nov-19 16:26pm.
|
|
|
|
|
This is not really a .NET issue, it would be better in the LINQ or SQL forums
|
|
|
|
|
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.
|
|
|
|
|
Can I go now and post the question there or am I going to hear Taunts from everybody for duplicate posts or is there anyways to just move this question to that forum - I wish if there could be, it is much easier and avoids duplicate postings, right?
|
|
|
|
|
I want to have Linq Query as below, but the not able to, its giving me compile time error any help please? The error is "inference failed to call the Join" - any help please? I want to use join within where clause of other query, is that possible? Thanks in advance.
Case _case = (from x in this.Context().CaseRepository.GetAll()
where (from g in x.Violations
join a in this.Context().OneToManyRepository.GetAll().Where(a => a.ParentEntity == "Notice" && a.ChildEntity == "Violation")
on new { g.ViolationId, this.NOVId } equals new { a.ChildEntityId, a.ParentId }
where g.CaseId == x.CaseId
select g).Count() > 0
select x).FirstOrDefault();
this.TriggerMetaDataUpdate<Case>(_case);
this.TriggerMetaDataUpdate<InspectionResult>(this.InspectionResult);
|
|
|
|