Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285

    Question about Entity Framework and SQL Database

    Hi
    If this question was asked before, excuse me because I didn't dig into the forums to see if it is a repetitive question or not, so here is the question :
    I was planning on a program for my office, the Idea is to have a SQL server on one of the computers (my own computer), then the program on every computer in the local network will contact this sql server to retrieve data I need. The question is, will entity framework find this instance of sql server on those computers in local network other than my own computer automatically or do i need to set the connection string for it? and if i need to set the connection string on the program, is there a way to secure this connection string or not?
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  2. #2
    Join Date
    Aug 2010
    Posts
    158
    I think you will need to write a connection string. Even locally running on your machine it still uses a connection string, it can just generate it for you as it knows the server is running locally. Just make sure you have no firewall issues blocking the connection on the server and it should be really easy to do. That's how I have a few servers at work doing it at least.

    Side note. If this is something that you are planning on doing a lot of. (SQL, Internal Websites, VMs, and more) I would recommend doing something like an Windows Azure Pack (Azure Stack on server 2016), OpenStack, or another local cloud solution. I know this is overkill, but it makes management and deployment so much easier in the end.

  3. #3
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    well, the thing is that i was planning to sell the software in my country when i was sure the software became bug proof, when you would sell a medical office software, you wouldn't have the glory of local cloud, also, i would need to somehow make the connection string secure and safe to keep patient data safe at the same time, and i still need to figure how bigger companies make silent installation of sql servers and make user name and password for the sql server itself :/ too many things i need to figure at the same time. I was thinking if i need to make the connection string secure, well, i may be able to encrypt it and then send the decrypted version to the EF context but again, i would need to find a way to get the installation instance of sql server in the network without the need of the customer to do it himself because 99.9% of medical doctors in my country know absolutely 0% knowledge about these stuff.
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  4. #4
    Join Date
    Feb 2009
    Posts
    69
    You can tell the sql server to only allow access from lan side, and disallow wan. Then, if you plant the connection string in a config file (encrypted of course), no one can access the lan from external sources and pluck your ip or login info.

    SQL is rather mature, and since over the years it's been one of the hardest hit from a hacker standpoint, it's becoming pretty bullet resistant.

    Just make sure the SQL server isn't accessible from the wan side, that the general user account doesn't have more rights than it needs, and that your config is encrypted. And you only allow access via ssl. Follow those guidelines, (and of course do your homework on your exact copy wether it's MySQL or mssql), and the data stored is relatively safe.

    We use a setup similar to what your describing at my work, although we have a seperate server that's dedicated for sql alone

  5. #5
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    thanks for guide,
    By the way, i was following nelson on chapter 10, but when i want to use Add-Migration Initial, i get this error :

    No MigrationSqlGenerator found for provider 'MySql.Data.MySqlClient'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators.

    How should I solve that?
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

  6. #6
    Join Date
    Jun 2008
    Location
    Iran / Tehran
    Posts
    285
    never mind, found my answer here :
    http://www.3dbuzz.com/forum/threads/...55#post1606155
    that local db connection really wanted to mess with me too
    If you want to learn something, start teaching about it to others, nothing will help you more than that !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •