safealloys 0 Newbie Poster

Please help me with this CODE. What I want to do is to update the existing data in my database.


Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlClient.SqlDataReader
Imports System.Transactions
Imports System.Collections
Imports System.Collections.Generic

Public Class SelectStaffManager
Const strConnectionString As String = "Server=(local);Initial Catalog=VideoClub;User ID=sa;Password="
#Region "SQL Statements"
Private Const SQL_SELECT_STAFF As String = "Select * From Staff"

Public Shared Function SELECTStaff(ByVal FirstName As String, ByVal LastName As String, ByVal ContactAddress As String, ByVal MaritalStatus As String, _
ByVal Sex As String, ByVal EmailAddress As String, ByVal DateofBirth As Date, ByVal DateofEmployment As Date, _
ByVal Photograph As String, ByVal PhoneNo As String, ByRef strMessage As String) As Integer
Dim SqlConn As SqlConnection = Nothing
Dim cmd As SqlCommand = Nothing
Dim SqlParm As SqlParameter = Nothing
Dim collectdata As SqlDataReader

Try


'Prepare the SqlCommand Object and all it's neccessary properties for data commission into the database
SqlConn = New SqlConnection(strConnectionString)
cmd = New SqlCommand(SQL_SELECT_STAFF, SqlConn)


'cmd.Connection.Open()

collectdata = cmd.ExecuteReader

cmd.Connection.Close()
Catch ex As Exception
collectdata = Nothing
strMessage = ex.Message
End Try
Return collectdata
End Function

#End Region

End Class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.