Hello,
I have added a table(ViolationsDataSourceConfig) to the dbml file.
The context name is ViolationsDataContext.
I am trying to write a function that should return employee object but it is throwing errors. Below is the code. Is there any easy way for achieving this. I just want the ViolationsDataSourceConfig.
Public Shared Function GetDataSourceDetails(ByVal ApplicationID As Integer) As ViolationsDataSourceConfig
Dim _db As New ViolationsDataContext
Dim appSource As New ViolationsDataSourceConfig
Dim application As Table(Of ViolationsDataSourceConfig) = _db.GetTable(Of ViolationsDataSourceConfig)()
Try
appSource = From a In application Where a.ApplicationID = ApplicationID And a.Status = 1 _
Select a
Catch ex As Exception
End Try
Return appSource
End Function