form connection to SQL server

JohnSe

Active member
Joined
Jun 17, 2019
Messages
27
Programming Experience
5-10
Hi,

Could someone provide some codes examples that can help me connect C# forms to SQL server that is trusted (without user name or password, just the server and database name).

Thanks
 
What driver did you select when testing this connection via Visual Studio?

Perhaps you should try using an OdbcConnection instead of a SqlConnection. The connection string for an ODBC connection should look like what you are using for VBA and R.
Actually the data source is
Microsoft SQL Server(SqlClient) which I think is what you meant by drive
What driver did you select when testing this connection via Visual Studio?

Perhaps you should try using an OdbcConnection instead of a SqlConnection. The connection string for an ODBC connection should look like what you are using for VBA and R.

For visual studio, tools, connect database, data source is Microsoft SQL Server (SqlClient) which I think is the driver. Let me try with ODBC. Do you have any fast code example if not I’ll look it up. Thx
 
Back
Top Bottom