Reputation: 41
I have created a little tool, which lets me write some data into a database.
This database is located on my laptop and as of until now, that tool was only able to locally access the database. I now need my friend to be able to use that tool to connect to my database from his own PC.
I've read about port-forwarding, opening the firewall, etc., but I've never really gotten the hang of it.
This is what I currently have:
SqlConnection myConnection = new SqlConnection("user id=admin;" +
"password=password;server=myDatabase;" +
"Trusted_Connection=yes;" +
"database=database; " +
"connection timeout=30");
And of course, the usual procedure:
try
{
myConnection.Open();
//Do Stuff
}
catch(Exception e)
{
Console.WriteLine(e.ToString());
}
Note: I don't really care much about security, since the usage of this tool is only temporary and I doubt that anyone would try to "break in".
Upvotes: 1
Views: 234
Reputation: 23078
Take a look upon activating Remote connections to your SQL Server Instance. As already mentioned, they will not work on Express editions, but since your project is temporary, you may install a trial (lasts for 180 days).
Upvotes: 1