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
Issues with SCCM CCMSetup client
How do I (re-)enable heap memory allocation within a CWinThread-derived class thread function invoked directly from InitInstance?
SQL union to fill date data series gaps for SSRS year on year chart
Out of Office Assistant not working w/Forwarding Configured
blue screen on Server2003 install
DAG & CAS array configured but it's not failover
Net Use returns "System error 64 has occurred. The specified network name is no longer available."
how to save blackberry notes
WRT54G2 Linksys router - reset password saving actual configuration
PHP/Javascript newbie - need help integrating niftycube into my site