Hello, the first question is, how do iknow if the SQLEXPRESS server that in my machine is work well? i have sqlExpress and i also have the sql studio management, i am creating database and tables and all works fine. but when im tryin to call to a database from visual studio the connection failed. (only with sql, with odbc, oledb with access files i get the connection).
the second question, If im writting some winform app and use the connection string Data Source=My server name (for example), How the app will work on some other machine? cause the server name is diffrent no? (i know its sound a little weired but im new in C# development and Databases {Still student}).
elidotnet
0
Junior Poster in Training
Recommended Answers
Jump to Post1) How are you trying to connect to the SQL Server inside of Visual Studio? You should be using a SQL Native connection
2) You need to create a "SQL Connection Form" in your application that lists the SQL Server and Databases and lets a user select where they …
Jump to PostWith Microsoft SQL Server you typically don't use the .mdf and .ldf files directly, you connect to the SQL Server with named pipes. Here is how you connect in code:
public static string BuildSqlNativeConnStr(string server, string database) { return string.Format("Data Source={0};Initial Catalog={1};Integrated Security=True;", server, database); } private …
All 5 Replies
sknake
1,622
Senior Poster
Featured Poster
elidotnet
0
Junior Poster in Training
elidotnet
0
Junior Poster in Training
sknake
1,622
Senior Poster
Featured Poster
elidotnet
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.