Greetings,
CONTEXT: I’m doing school work on a WPF application in C# using Microsoft SQL Server. The work is in a team of two. We have to create a simple application that is linked in a database with ADO.NET.
PROBLEM: Since we need to work in team, we are using C# for the code. However, the problem is with the database link itself. Using entity framework/ADO: how can we make it work since the server is our own local computer and is different? For the scripts themselves we can just export and share the .sql, but for the model import and so on, I have no clue. I asked my professor and he said we could use two entity with two database and so on. Not only did it seemed very patchwork and “dangerous” for corrupting data, but it was cryptic and I’m not even sure how to do it.
QUESTION: Is there a simple (or at least a way that’s safe for the code) way to just change the “path” of the server when using ADO.NET / entity framework?
Thank you.
Are you asking about the actual connection string to use? You can just use (local) for the data source, or (local)InstanceName if it is named (most likely).
Data Source=(local); Initial Catalog=DBNameHere;User ID=UsernameHere;Password=SuperSecureL33TPasswordHere;
Hello! Thanks for replying.
I’ve seen “connection string” thrown around while doing google, and yet I couldn’t find it in my files.
“InstanceName” in your example would be the server name? Or is it the ID that’s the server name? In the case of the default for MSQL it would be the computer name?
C# devs
null reference exceptions