|
-
Jan 24th, 2003, 03:39 PM
#1
Thread Starter
Member
My First Class
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
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
|
Click Here to Expand Forum to Full Width
|