Rohatash Kumar

Rohatash Kumar

  • 8
  • 58.5k
  • 33.2m

Problem in Connection String in VB.NET

Dec 28 2012 12:24 AM
Hi all,

Below is the connection string in my app.config file in Window forms application.

<add name="ConnectionString1" connectionString="Data Source=.;uid=sa;pwd=wintellect;database=test;" providerName="System.Data.sqlclient"/>

 I got this error : "Object reference not set to an instance of an object." in windows application for sql connection string here is the code:
Dim str As String= ConfigurationManager.ConnectionStrings("ConnectionString1").ConnectionString

Answers (6)