Remoting problem in VB.net
.NET (Core and Framework)
1
Posts
1
Posters
0
Views
1
Watching
-
I have a program that I need to figure out what is going on. First, the code: Class ListItemServer ---
Imports System.Data
Imports system.Data.SqlClientPublic Class ListItemServer
Inherits MarshalByRefObject
Implements ILists
Private mSQL As SqlConnection
Private mDA As SqlDataAdapterPublic Sub New() mSQL = New SqlConnection(Config.GetConnectionString) mDA = New SqlDataAdapter End Sub
#Region " Affiliation Types "
Public Function GetAffiliations() As System.Data.DataSet &_
Implements ILists.GetAffiliations
Dim SelectCommand As New &_
SqlClient.SqlCommand("tff_GetAffiliations", mSQL)
mDA.SelectCommand = SelectCommand
mDA.SelectCommand.CommandType = CommandType.StoredProcedureDim Data As New DataSet("AffiliationTypes") mDA.Fill(Data) Return Data End Function Public Function UpdateAffiliations(ByVal Data As System.Data.DataSet) As DataSet &\_ Implements ILists.UpdateAffiliations Dim SelectCommand As New &\_ SqlClient.SqlCommand("tff\_GetAffiliations", mSQL) Dim InsertCommand As New &\_ SqlClient.SqlCommand("tff\_AddAffilation", mSQL) Dim UpdateCommand As New &\_ SqlClient.SqlCommand("tff\_UpdateAffiliation", mSQL) Dim DeleteCommand As New &\_ SqlClient.SqlCommand("tff\_DeleteAffiliation", mSQL) SelectCommand.CommandType = CommandType.StoredProcedure InsertCommand.CommandType = CommandType.StoredProcedure UpdateCommand.CommandType = CommandType.StoredProcedure DeleteCommand.CommandType = CommandType.StoredProcedure With mDA .SelectCommand = SelectCommand .InsertCommand = InsertCommand .UpdateCommand = UpdateCommand .DeleteCommand = DeleteCommand End With With InsertCommand.Parameters ' Parameters End With With UpdateCommand.Parameters .Add("@AffiliationTypeID", SqlDbType.Int, 4, "AffiliationTypeID") ' Parameters End With With DeleteCommand.Parameters .Add("@AffiliationTypeID", SqlDbType.Int, 4, "AffiliationTypeID") End With Try mDA.Update(Data) Catch sqlex As SqlException Console.WriteLine(sqlex.Message) Catch ex As Exception Console.WriteLine(ex.Message) End Try