Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I've managed thanks to you guys to set up my SQL-Server and I'm currently using the following connection string:

C#
public static string constr = @"Data Source=ASUS-PC\SQLEXPRESS;
                        AttachDbFilename=C:\Users\ASUS\Desktop\basededados\cybercafe.mdf;
                        Integrated Security=True;User Instance=True;";


My question is if I have to change the connectionstring for the user, or if it's the same as above.
I'm making a cybercafe application, the admin logs in and manages the users in the server, which is in my laptop. And the users log into the server from diferent computers accessing the database that is in my laptop.

Remark that the computers including my laptop(server) are going to be on the same network.
Posted
Comments
Steven Borges 5-Mar-13 9:49am    
Also want to say that I'm sorry for hitting on the same rock over and over again, but it's the first time I'm making such a major application and I'm quite excited about it.

1 solution

I think this[^] is what you are looking for.

Using Settings in C# - MSDN[^]

Good luck,
OI
 
Share this answer
 
Comments
Steven Borges 7-Mar-13 5:42am    
Correct me if I'm wrong, but what you provided answered nothing of what I asked for.
Orcun Iyigun 7-Mar-13 6:39am    
Well you should correct me because you are also not clear. It is really hard to understand what your question is from your question? I answered your question based on to the following sentence: "if I have to change the connectionstring for the user, or if it's the same as above." Also can you show me the line where you asked your question instead of giving justifications? And "My question is if I have to change the connectionstring for the user, or if it's the same as above." this is not clear at all..
Steven Borges 7-Mar-13 14:17pm    
Just looking at the code and then the explanation is more than enough.
tl;dr: Just want to know if I have to change the data source to access my database from the laptop which is my server, knowing I'm in the same network trying to access the .mdf from another machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900