How to make connection with SQL Server on another computer?
-
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?
-
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?
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.
-
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?
-
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?
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