Add Interface and Server Implementation

Top  Previous  Next

13.Click Open the CSAccountDatabaseIntf.vb

 

clip0151

 

 

 

14. Add 2 sub and 1 function :

LoadxxxDataset - To fill the dataset

SavexxxDataset - To Save the Dataset

GetxxxDataset - Return the dataset after call to LoadxxxDataset.

 

clip0153

15. Go to CSServer assembly and select CSSystemManager.vb

 

clip0156

 

 

16. Move cursor to ICSAccountDatasetIntf with underline, then press enter

 

clip0154

 

 

 

17. The 2 defined sub and 1 function will be automatically added.

 

clip0158

 

 

18. Then create the following implementation...

 

   Private dsxxxDataset As CSAccountDatabaseIntf.DataSet1

   Private Sub CreatexxxDataset()

       If dsxxxDataset Is Nothing Then

           dsxxxDataset = New CSAccountDatabaseIntf.DataSet1

       End If

   End Sub

 

   Public Function GetxxxDataset() As CSAccountDatabaseIntf.DataSet1 Implements CSAccountDatabaseIntf.ICSAccountDatabaseIntf.GetxxxDataset

       CreatexxxDataset()

       Return dsxxxDataset

   End Function

 

   Public Sub LoadxxxDataset() Implements CSAccountDatabaseIntf.ICSAccountDatabaseIntf.LoadxxxDataset

       Dim daAccount As CSAccountDatabaseIntf.DataSet1TableAdapters.MST_ACCOUNTTableAdapter = New CSAccountDatabaseIntf.DataSet1TableAdapters.MST_ACCOUNTTableAdapter

       CreatexxxDataset()

       daAccount.Fill(dsxxxDataset.MST_ACCOUNT)

   End Sub

 

   Public Sub SavexxxDataset(ByVal InDataset As CSAccountDatabaseIntf.DataSet1) Implements CSAccountDatabaseIntf.ICSAccountDatabaseIntf.SavexxxDataset

       Dim daAccount As CSAccountDatabaseIntf.DataSet1TableAdapters.MST_ACCOUNTTableAdapter = New CSAccountDatabaseIntf.DataSet1TableAdapters.MST_ACCOUNTTableAdapter

       daAccount.Update(InDataset.MST_ACCOUNT)

   End Sub