B
Brett
I'm using this code in VS .NET 2003
At the while statement, I get a data ready already open for this connection
error. If I remove the line cn2.open(), I get an error about the connection
being closed. This should say that no other resource is using the
connection. What else could be wrong?
Thanks,
Brett
Code:
Me.SqlCmd_BlacklistUpdateStatus.CommandText =
"dbo.[SpamUpdateReport_blacklist]"
Me.SqlCmd_BlacklistUpdateStatus.CommandType =
System.Data.CommandType.StoredProcedure
Me.SqlCmd_BlacklistUpdateStatus.Connection = Me.cn2
Me.SqlCmd_BlacklistUpdateStatus.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
Me.SqlCmd_BlacklistUpdateStatus.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@messageid", System.Data.SqlDbType.Int,
4))
Me.SqlCmd_BlacklistUpdateStatus.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@subpart",
System.Data.SqlDbType.SmallInt, 2))
'
cn2.Open()
'loop through returned records
Dim drspfblacklist As SqlDataReader
drspfblacklist = SqlCmd_SpamUpdate_spfBlackUnprocessed.ExecuteReader()
While drspfblacklist.Read
At the while statement, I get a data ready already open for this connection
error. If I remove the line cn2.open(), I get an error about the connection
being closed. This should say that no other resource is using the
connection. What else could be wrong?
Thanks,
Brett