Thread: Survey Engine
View Single Post
Old March 3rd, 2008, 02:30 AM
Dennis239 Dennis239 is offline
Registered User
Join Date: Mar 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts

Yes. Of course what you posted is better. And to be honest I can't believe Imar wrote Chapters 4 and 7 (I haven't read the remainder yet). Take this function from Capter 7 - Photogallery
    Public Shared Function InsertCollection(ByVal pc As PhotoCollection) As Boolean


            Dim conn As New SqlConnection()
            Dim cmd As New SqlCommand()
            conn.ConnectionString = PhotoDB.ConnectionString
            cmd.Connection = conn
            cmd.CommandType = CommandType.StoredProcedure
            cmd.CommandText = "add_collection"

            ' Create a SqlParameter for each parameter in the stored procedure.
            Dim nameParam As New SqlParameter("@name",
            Dim descParam As New SqlParameter("@desc", pc.description)


            Return True

        Catch ex As Exception

            Throw (ex)

        End Try

    End Function
Where connection is closed?
Catch ex As Exception

      Throw (ex)

End Try
What is this?