Amigo_fd
02-14-2005, 10:43 AM
Hello,
I'm rather new to asp.net and I'm trying to build a VB webservice for Flash which returns database sql-results.
The problem is that Flash doesn't support native ASP.NET datasets. So the sql result should be transformed in an Array or some other kind of simple xml.
Does anyone have some samples on how to do this ?
The code should be smart enough to build the array or xml according to the sql-result, so I can send any kind of sql-statement to it.
This is my first attempt ... :
<%@ Webservice Language="VB" Class="DatabaseServices" %>
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.Services
Public Class DatabaseServices : Inherits WebService
<WebMethod()> public function GetSql(doSql as String) as String
Dim objCon As OleDbConnection = New OleDbConnection("... this is ok !")
Dim cmdSQL As OleDbDataAdapter = New OleDbDataAdapter(doSql, objCon)
'code to return the result
end function
End Class
the returning xml could look like this:
this could be the example of the return xml:
<results>
<result>
<field1name>field1value</field1name>
<field2name>field2value</field2name>
...
</result>
...
</results>
I'm rather new to asp.net and I'm trying to build a VB webservice for Flash which returns database sql-results.
The problem is that Flash doesn't support native ASP.NET datasets. So the sql result should be transformed in an Array or some other kind of simple xml.
Does anyone have some samples on how to do this ?
The code should be smart enough to build the array or xml according to the sql-result, so I can send any kind of sql-statement to it.
This is my first attempt ... :
<%@ Webservice Language="VB" Class="DatabaseServices" %>
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Web.Services
Public Class DatabaseServices : Inherits WebService
<WebMethod()> public function GetSql(doSql as String) as String
Dim objCon As OleDbConnection = New OleDbConnection("... this is ok !")
Dim cmdSQL As OleDbDataAdapter = New OleDbDataAdapter(doSql, objCon)
'code to return the result
end function
End Class
the returning xml could look like this:
this could be the example of the return xml:
<results>
<result>
<field1name>field1value</field1name>
<field2name>field2value</field2name>
...
</result>
...
</results>