|
-
System.InvalidOperationException: ExecuteReader: Connection property has not been initialized
Hi, I'm a newbie and I have this problem when working with a user control:
System.InvalidOperationException: ExecuteReader: Connection property has not
been initialized
It is a simple User Control, with just a sql connection string and a stored
procedure:
----------------------------------------------------------------------------
--------
SqlConexio = New System.Data.SqlClient.SqlConnection()
SqlConexio.ConnectionString = "the connection string - I don't write in the
forum for obvious reasons, but I know it's OK"
'the Stored Procedure
cmdIncrementarComptador = New System.Data.SqlClient.SqlCommand()
cmdIncrementarComptador.CommandText = "qe842.[Bruno_Comptador_Seleccio]"
cmdIncrementarComptador.CommandType =
System.Data.CommandType.StoredProcedure
cmdIncrementarComptador.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(10, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
SqlConexio.Open()
cmdIncrementarComptador.ExecuteNonQuery()
SqlConexio.Close()
--------------------------------------------------------------
The error appears when Executing the Stored Procedure...
any ideas? TIA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks