March 28, 2006 at 8:12 am
SQL connection string from web.config:
add
key="conString" value="server=dbh_mpstrasser;uid=mpstrasser;pwd=island09!;database=PRAXIS"
When issuing the conn.Open(); command I receive the following error message: + base {"Invalid operation. The connection is closed."} System.SystemException {System.InvalidOperationException}
Of course it is closed and I am issuing an open command.
I am thinking there is a problem with the connection string.
This is my first attempt at connection to SQL Server 2005 database. I am able to bring up SQL Server Management Studio and connect using the same userid/password combination.
March 31, 2006 at 8:00 am
This was removed by the editor as SPAM
March 31, 2006 at 8:24 am
Hello,
1. Did you create a connection object before trying to open it?
2. Try the connection string from VBscript to make sure connection string works independently from you .NET application. let us know if you need an example.
Regards,Yelena Varsha
March 31, 2006 at 11:30 am
I ended up using this connection string:
<
add key="conString" value="Data Source=DBH_MPSTRASSER;Initial Catalog=PRAXIS;user id=mpstrasser;password=island09!;Integrated Security=True;Trusted_Connection=Yes"/>
and it was successful.
Do I need to close this somehow?
April 3, 2006 at 9:19 am
Yes, you should close connections if you don't need them anymore.There is an overhead when esteblishing a new connection so close your connection only when the task for this connection is accomplished.
Or you can use MARS (Multiple Active Recordsets) feature of ADO.NET and SQL Server 2005 to use the same connection to return multiple recordsets. See
http://msdn2.microsoft.com/en-us/library/ms130978(SQL.90).aspx
Using ADO with SQL Native Client
Regards,Yelena Varsha
April 7, 2006 at 5:43 am
Visual Studio 2005 and SQL 2005 are tighly integrated. One need not write any connection string. When you configure the data source, the connection string is automatically crated. But due to bugs in Visula Studio 2005, the connection may fail now and then
V.Kadal Amutham
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply