Flex2 and .NET datasets don't play well together. You can cast your dataset to a class (see below) to make it work.
-TH
ASP.NET Code:
Public Class authorVO
Public authorID As Integer
Public authorName As String
Public authorStatus As String
End Class
<WebMethod()> _
Public Function getAuthors(ByVal authorID As Integer) As authorVO()
Dim myConnection As SqlConnection = New _
SqlConnection("server=YourServerName;uid=YourUserID;pwd=YourPassword;database=authors")
Dim myCommand As SqlCommand = New _
SqlCommand("getAuthors", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
Dim paramAuthorID As SqlParameter = New SqlParameter("@AuthorID", SqlDbType.Int)
paramAuthorID.Value = authorID
myCommand.Parameters.Add(paramAuthorID)
myConnection.Open()
Dim myDataAdapter As SqlDataAdapter = New SqlDataAdapter
myDataAdapter.SelectCommand = myCommand
Dim ds As DataSet = New DataSet
myDataAdapter.Fill(ds, "DataSet")
myConnection.Close()
myConnection.Dispose()
Dim i As Integer
i = 0
Dim authors As authorVO() = New authorVO(ds.Tables(0).Rows.Count - 1) {}
Dim aRow As DataRow
For Each aRow In ds.Tables(0).Rows
authors(i) = New authorVO
authors(i).authorID = CInt(aRow("authorID"))
authors(i).authorName = CStr(aRow("authorName"))
authors(i).authorStatus = CStr(aRow("authorStatus"))
i += 1
Next
Return authors
ds.Dispose()
myDataAdapter.Dispose()
End Function
--- In [email protected], "vestcomprogrammer" <[EMAIL PROTECTED]> wrote:
>
> Does anyone know if we will be able to use .net DataSet with Flex 2.0?
>
>
>
> Bill
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
| Web site design development | Computer software development | Software design and development |
| Macromedia flex | Software development best practice |
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

