Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to make connection with SQL Server on another computer?

How to make connection with SQL Server on another computer?

Scheduled Pinned Locked Moved C#
csharpdatabasequestionsql-servervisual-studio
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alex Dunlop
    wrote on last edited by
    #1

    Hi, I use SQL Server 2019. I have created a simple database in SQL Server and made a connection in C# (Visual Studio 2019) with that SQL database. I can read and write information on that SQL database using C#. My problem is that my final application wouldn't have access to the SQL Server because it is in my PC and connects using my windows user/pass. How can I make my database dynamic so my users can access it?

    B D L 3 Replies Last reply
    0
    • A Alex Dunlop

      Hi, I use SQL Server 2019. I have created a simple database in SQL Server and made a connection in C# (Visual Studio 2019) with that SQL database. I can read and write information on that SQL database using C#. My problem is that my final application wouldn't have access to the SQL Server because it is in my PC and connects using my windows user/pass. How can I make my database dynamic so my users can access it?

      B Offline
      B Offline
      BabyYoda
      wrote on last edited by
      #2

      You connect to a sql db using a connection string. Somewhere in your code or web.config or app.config (depending on what type of project you have) is a connection string which tells the code how to connect to the sql database. You can either put the database somewhere everyone has access to and update your connection string to point to it or you can expose your database on the network, which it might already be.

      1 Reply Last reply
      0
      • A Alex Dunlop

        Hi, I use SQL Server 2019. I have created a simple database in SQL Server and made a connection in C# (Visual Studio 2019) with that SQL database. I can read and write information on that SQL database using C#. My problem is that my final application wouldn't have access to the SQL Server because it is in my PC and connects using my windows user/pass. How can I make my database dynamic so my users can access it?

        D Offline
        D Offline
        DerekT P
        wrote on last edited by
        #3

        Google "sql server allow remote connections"

        1 Reply Last reply
        0
        • A Alex Dunlop

          Hi, I use SQL Server 2019. I have created a simple database in SQL Server and made a connection in C# (Visual Studio 2019) with that SQL database. I can read and write information on that SQL database using C#. My problem is that my final application wouldn't have access to the SQL Server because it is in my PC and connects using my windows user/pass. How can I make my database dynamic so my users can access it?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Use SQLite; that way you can embed the DB in you app. Other than the connection string, it's the same as SQL Server (except, maybe, in the area of stored procs). In fact, VS uses SQLite; and it's "part of" WIndows 10. [Convert SQL Server DB to SQLite DB](https://www.codeproject.com/Articles/26932/Convert-SQL-Server-DB-to-SQLite-DB) [Microsoft SQL Server vs. SQLite Comparison](https://db-engines.com/en/system/Microsoft+SQL+Server%3BSQLite)

          It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups