Skip navigation
phatnq2002
Currently Being Moderated

Connect to a MS SQL Server database

Jun 11, 2008 3:01 AM

Dear all,
Please tell me how to connect to a MS SQL Server database in Flex 3.
Thanks a lot !
 
Replies
  • Currently Being Moderated
    Jun 11, 2008 4:09 AM   in reply to phatnq2002
    You can't!

    Flex cannot *directly* connect to SQL Server or any other database for that matter.

    You get data into flex using a HTTP layer: like for example using a ASP or ASP.NET page to generate XML -- or any other format of your choice JSON, CVS -- use HTTPService class, send a request to your server, get the data using result event of the class and do whatever you want to do wit this data.

    Similarly, you'll need to post the data to the server over HTTP and store in the database.

    There is no FDBC, like JDBC and ODBC!

    ATTA
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 11, 2008 8:37 PM   in reply to phatnq2002
    No. You don't have to.

    Consider a ASP.NET page. It can connect to SQL Server using ODBC driver -- or whatever MS call the driver these days -- you run your query and get a result set. you process the result set and convert it to an XML string. Maybe using some library or built-in support for XML in .NET framework. Now you XML ready. Just write to the Response object of your page.

    Have you made any Ajax calls for data in your project? If so, you already know how to get this data in Flex. Using HTTPService class instead of XMLHTTPRequest.

    ATTA
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 12, 2008 5:07 AM   in reply to phatnq2002
    it's very simple you just need to give url in httpservices of your aspx page.......... Instead to using aspx page use webservice in asp.net ........
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 18, 2009 9:03 AM   in reply to phatnq2002

    Please checkout these two detailed blog entries (tutorials ) on Flex- SQL Server Connection.
    Part1 - http://codeexpander.blogspot.com/2009/10/connecting-flex-to-sql-server .html
    Part 2 - http://codeexpander.blogspot.com/2009/10/connecting-adobe-flex-to-sql- server.html

    Hope this will help.

    Thanks,

    Amrit

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points