Hi, guys. I'm pretty new to both Silverlight and WCF. What I'm trying to do is provide a database connection to my Silverlight object. The problem I'm having, though, is that my web service, while it compiles fine, doesn't seem to be returning anything at all. I've used Fiddler, and tried a custom request, but the service itself isn't returning anything at all.
My service code:
Imports System.ServiceModel
Imports System.ServiceModel.Activation
Imports System.Data.OleDb
Imports System.Runtime.Serialization
<ServiceContract(Namespace:="")> _
<AspNetCompatibilityRequirements(RequirementsMode := AspNetCompatibilityRequirementsMode.Allowed)> _
Public Class DBConnection
Dim dbConn As OleDbConnection
Private Function OpenConnection(ByVal strConnection As String) As Boolean
Try
Dim blnConnected As Boolean = False
dbConn = New OleDbConnection(strConnection)
dbConn.Open()
Catch ex As OleDbException
Return False
End Try
Return True
End Function
Private Function CloseConnection() As Boolean
Try
dbConn.Close()
dbConn = Nothing
Catch ex As OleDbException
Return False
End Try
Return True
End Function
<OperationContract()> _
Public Function GetDataTable(ByVal strSQL As String, ByVal strConnection As String) As DataTable
If dbConn Is Nothing Then OpenConnection(strConnection)
Dim dtTable As New DataTable
Dim dbAdapter As New OleDbDataAdapter(strSQL, dbConn)
dbAdapter.Fill(dtTable)
CloseConnection()
Return dtTable
End Function
End Class
When I breakpoint it on the last line of GetDataTable, there ARE results there. And I know it's hitting the service because of that, too.
So obviously, I'm doing something wrong, but I have absolutely no idea what.