I have created a class which accepts an sqlstring and an open connection and executes the sql returing an error message if one was thrown. I don't know if I should add a dispose to the class or what else I should add. This is my first class I created, so any suggestions of how I can enhance the code to make it better please let me know. I tested the class and it does what it is suppose too.
Public Class RunSql
Dim Err As SqlException
Sub Execute(ByVal SqlString As String, ByVal MyCnn As SqlConnection)
Dim e As SqlException
Dim myCMD As New SqlCommand(SqlString, MyCnn)
Try
myCMD.ExecuteNonQuery()
Catch e
Err = e
Finally
End Try
End Sub
ReadOnly Property SqlErr() As SqlException
Get
Return Err
End Get
End Property
End Class
Frank
