Microsoft
Software
Hardware
Network
Question : SQL Server connection throws System.InvalidOperationException
Hi I am trying to connect to a SQL 2008 64 bit database from a c# porogram coded in Visual C# 2005 express.
My connection string is as follows.
SqlConnection myConnection = new SqlConnection("uid=UerserI
D;pwd=Pass
word;serve
r=serverna
me.domain.
local;Trus
ted_Connec
tion=False
;database=
MyDatabase
Name;conne
ction timeout=30");
this fails with a systeminvalidoperationexce
ption.
Can any assist me to get this working.
Answer : SQL Server connection throws System.InvalidOperationException
You get an InvalidOperationException when you try to execute an operation on an object but the object is not yet in he right state to be executed.
It could be because you don't open the connection.
Can you post the code what executes the connection
Random Solutions
IIS 6.0 asp.net 2.0 cpu performance issue
Counting number of days between two dates using C#
Delete first 1 or 2 rows from csv/text delimited file
How many database instance that can be supported by SQL Server 2008 Standard Edition?
How do I add a due date column, and sort by the document date in AR Statements?
System Restore Points Not Created on Win 7
Dynamics AX 2009 - AOS Performance
execution of procedure
exhcnage 2010 Hub Transport load balancing
VMware mount-exe not working in Windows 7 64bit