connection string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hai I am developing ASP.NET application in c#, when i am trying to execute the datareader to read the values from the table i am getting this error: ExecuteReader requires an open and available Connection. The connection's current state is Close

Mine is a sqlserver 2000, and my connection string is "workstation id=CHOWIZ-3TZDPTXM;packet size=4096;integrated security=SSPI;data source=CHOWIZ-3TZDPTXM;persist security info=False;initial catalog=Assessment"; I got the error in a line conn.open()

what could be the cause?
 
Hi,

Check next example

http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProvider

--
Val Mazur
Microsoft MVP
Check Virus Alert, stay updated
http://www.microsoft.com/security/incident/blast.asp


geetha said:
hai I am developing ASP.NET application in c#, when i am trying to execute
the datareader to read the values from the table i am getting this error:
ExecuteReader requires an open and available Connection. The connection's
current state is Closed
Mine is a sqlserver 2000, and my connection string is "workstation
id=CHOWIZ-3TZDPTXM;packet size=4096;integrated security=SSPI;data
source=CHOWIZ-3TZDPTXM;persist security info=False;initial
catalog=Assessment"; I got the error in a line conn.open();
 
Hi,

Your problem is that you are using integrated security, thus your app uses
aspnet account to logon to Sql server.
You might change it to Sql Server authentication or change the account under
which asp.net application is running.
Example:
Just put a line into web.config file somewhere under
<system.web> node:

<identity impersonate="true" userName="USER" password="PASSWORD"/>

--
Miha Markic - RightHand .NET consulting & software development
miha at rthand com

geetha said:
hai I am developing ASP.NET application in c#, when i am trying to execute
the datareader to read the values from the table i am getting this error:
ExecuteReader requires an open and available Connection. The connection's
current state is Closed
Mine is a sqlserver 2000, and my connection string is "workstation
id=CHOWIZ-3TZDPTXM;packet size=4096;integrated security=SSPI;data
source=CHOWIZ-3TZDPTXM;persist security info=False;initial
catalog=Assessment"; I got the error in a line conn.open();
 
Back
Top