Joy
Joy

Reputation: 7028

connectionstring with userid but blank password for ado.net C#

I am not able to connect to the server say for instance from SQL Server Management Studio I am able to connect to the server 192.168.7.3 as server address using SQL Server authentication and also using the user ID as super.

But can someone tell me how to give the connectionstring so that I can use a blank password for the user "super" from the ado.net connectionstring so that I can connect to the server using SqlConnection object something like this :

SqlConnection con = new SqlConnection("server=192.168.7.3;database=test;user ID=super;password=");

I'm trying this but it's not working. What's the actual syntax to use a blank password for the server connection in sqlconnection object?

Note, this is the requirement. I know using blank password isn't recommended, but I am forced to do this.

Upvotes: 0

Views: 5354

Answers (1)

pabdulin
pabdulin

Reputation: 35219

The following ConnectionString should work. If not, the problem is elsewhere, perhaps network related.

Data Source=192.168.7.3;Initial Catalog=test;User Id=super;Password=;

Reference: SqlConnection.ConnectionString Property

Upvotes: 2

Related Questions