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
SQL 2008 Job can't start/stop services
Add DC to Windows Server 2003 Network - error msg
I have designed an website in flash as well in html, if the browser dont have flash then i want them to be directed to the html version, or else they need to directed to flash version
CodeDom and Windows Forms
Discrete Math, Big O, Little o
How to Setup Mandatory Profiles Server 2008 R2
VBA Convert long date format to short date
Backup Exec 12
my phone number would accept
Need to monitor specific events in SCOM 2007 R2