can .net activex communicate with database using ASP.net/ADO

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tuvman

    can .net activex communicate with database using ASP.net/ADO

    We are developing a web application. Our web app is a heavy client-
    our existing .net app exposed as an activex control running in IE. We
    need the activex to be able to access our remote database server when
    hosted within a browser from anywhere.Origin ally we were planning on
    using port forwarding...an d having the externalip:data baseport forward
    from the web server to the database server. But our customer's network
    admin says this is not possible and everything must go through the web
    server..port 80.

    We have dozens of stored procedures and dozens of methods written
    already which use ADO.NET. Is it possible to connect to ASP.NET using
    ADO, execute a request on the database server, and then return the
    results as an ADO.net resultset? If not how would you propose we have
    the ActiveX communicate with the database without having to write a
    lot of code on both the client and server side.

    thanks,
    Tuviah
  • George

    #2
    Re: can .net activex communicate with database using ASP.net/ADO

    Probably the easiest way is to build custom Stub/Proxy

    So lets say you have GetData.aspx which takes parameter SQL that is just run
    agains SQL database.
    And this GetData.aspx does something like
    DataTabe.WriteX ml(Response.Out putStream)

    On client side if you have your ActiveX written on .NET you could


    HttpWebRequest req =
    WebRequest.Crea te("http://www.myserver.co m/GetData.aspx?SQ L" )
    ......
    Stream st = req.GetResponse ().GEtResponse. Stream();
    DataTable.ReadX ml(stream)
    ....

    I hope you got an idea....
    You will need to somehow make is secure though, so people could not delete
    your database (by accident :)


    George.




    "tuvman" <tuvman@gmail.c omwrote in message
    news:0745895b-3077-4ca9-953c-29f20454d23e@e5 3g2000hsa.googl egroups.com...
    We are developing a web application. Our web app is a heavy client-
    our existing .net app exposed as an activex control running in IE. We
    need the activex to be able to access our remote database server when
    hosted within a browser from anywhere.Origin ally we were planning on
    using port forwarding...an d having the externalip:data baseport forward
    from the web server to the database server. But our customer's network
    admin says this is not possible and everything must go through the web
    server..port 80.
    >
    We have dozens of stored procedures and dozens of methods written
    already which use ADO.NET. Is it possible to connect to ASP.NET using
    ADO, execute a request on the database server, and then return the
    results as an ADO.net resultset? If not how would you propose we have
    the ActiveX communicate with the database without having to write a
    lot of code on both the client and server side.
    >
    thanks,
    Tuviah

    Comment

    • Alvin Bruney [ASP.NET MVP]

      #3
      Re: can .net activex communicate with database using ASP.net/ADO

      ActiveX controls in .NET don't exist. But your approach is workable. Another
      approach would be to write a web service sitting on the server that does the
      query to the database. The activex control can query the webserice using
      xmlhttp or something similar. That approach is safer because the activex
      doesn't know about the database. The webservice handles the 'forwarding' and
      is hosted on your secure server.

      --

      Regards,
      Alvin Bruney [MVP ASP.NET]

      [Shameless Author plug]
      Download OWC Black Book, 2nd Edition
      Exclusively on www.lulu.com/owc $15.00
      Need a free copy of VSTS 2008 w/ MSDN Premium?

      -------------------------------------------------------


      "George" <noemail@comcas t.netwrote in message
      news:u3thCaj4IH A.4696@TK2MSFTN GP02.phx.gbl...
      Probably the easiest way is to build custom Stub/Proxy
      >
      So lets say you have GetData.aspx which takes parameter SQL that is just
      run agains SQL database.
      And this GetData.aspx does something like
      DataTabe.WriteX ml(Response.Out putStream)
      >
      On client side if you have your ActiveX written on .NET you could
      >
      >
      HttpWebRequest req =
      WebRequest.Crea te("http://www.myserver.co m/GetData.aspx?SQ L" )
      .....
      Stream st = req.GetResponse ().GEtResponse. Stream();
      DataTable.ReadX ml(stream)
      ...
      >
      I hope you got an idea....
      You will need to somehow make is secure though, so people could not delete
      your database (by accident :)
      >
      >
      George.
      >
      >
      >
      >
      "tuvman" <tuvman@gmail.c omwrote in message
      news:0745895b-3077-4ca9-953c-29f20454d23e@e5 3g2000hsa.googl egroups.com...
      >We are developing a web application. Our web app is a heavy client-
      >our existing .net app exposed as an activex control running in IE. We
      >need the activex to be able to access our remote database server when
      >hosted within a browser from anywhere.Origin ally we were planning on
      >using port forwarding...an d having the externalip:data baseport forward
      >from the web server to the database server. But our customer's network
      >admin says this is not possible and everything must go through the web
      >server..port 80.
      >>
      >We have dozens of stored procedures and dozens of methods written
      >already which use ADO.NET. Is it possible to connect to ASP.NET using
      >ADO, execute a request on the database server, and then return the
      >results as an ADO.net resultset? If not how would you propose we have
      >the ActiveX communicate with the database without having to write a
      >lot of code on both the client and server side.
      >>
      >thanks,
      >Tuviah
      >

      Comment

      • tuvman

        #4
        Re: can .net activex communicate with database using ASP.net/ADO

        >Probably the easiest way is to build custom Stub/Proxy
        >So lets say you have GetData.aspx which takes parameter SQL that is just run
        >agains SQL database.
        >And this GetData.aspx does something like
        Can you give me more details on this approach? How do I get ASP to
        execute the query and return an ADO recordset? Also won't we have to
        make major changes to the way we are executing stored procedures (we
        ADO Command and parameters object).

        I also started reading a little about passing data over web services.
        Is this something to consider?

        thanks,
        Tuviah

        Comment

        Working...