Hi. I'm working in a VB.NET project. My problem is in my project i've created a
class clsdatabase where all the connection and executing the query is done. But when i run program the insert and update query runs few times and
later without any change of coding i get "Object variable Block variable not set".
I get this error in the following code..
inside the class clsdatabase
Why it's happening like this? Please help me rectify this problem. It's making
the whole program not run. Thank u for u'r help in advance.
class clsdatabase where all the connection and executing the query is done. But when i run program the insert and update query runs few times and
later without any change of coding i get "Object variable Block variable not set".
I get this error in the following code..
VB.NET:
dim DbObj = New ClsDatabase
DbObj.ExecuteQuery("Here is the update query")
inside the class clsdatabase
VB.NET:
Public Sub ExecuteQuery(ByVal strSql As String)
Dim cmd As SqlCommand
If sqlQryCon.State = ConnectionState.Open Then sqlQryCon.Close()
cmd = New SqlCommand(strSql, sqlQryCon)
sqlQryCon.Open()
cmd.ExecuteNonQuery()
sqlQryCon.Close()
End Sub
the whole program not run. Thank u for u'r help in advance.
Last edited by a moderator: