469,322 Members | 1,603 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

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.Originally we were planning on
using port forwarding...and having the externalip:databaseport 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
Jul 10 '08 #1
3 1702
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.WriteXml(Response.OutputStream)

On client side if you have your ActiveX written on .NET you could
HttpWebRequest req =
WebRequest.Create("http://www.myserver.com/GetData.aspx?SQL" )
......
Stream st = req.GetResponse().GEtResponse.Stream();
DataTable.ReadXml(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" <tu****@gmail.comwrote in message
news:07**********************************@e53g2000 hsa.googlegroups.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.Originally we were planning on
using port forwarding...and having the externalip:databaseport 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
Jul 10 '08 #2
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?
http://msmvps.com/blogs/alvin/Default.aspx
-------------------------------------------------------
"George" <no*****@comcast.netwrote in message
news:u3**************@TK2MSFTNGP02.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.WriteXml(Response.OutputStream)

On client side if you have your ActiveX written on .NET you could
HttpWebRequest req =
WebRequest.Create("http://www.myserver.com/GetData.aspx?SQL" )
.....
Stream st = req.GetResponse().GEtResponse.Stream();
DataTable.ReadXml(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" <tu****@gmail.comwrote in message
news:07**********************************@e53g2000 hsa.googlegroups.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.Originally we were planning on
using port forwarding...and having the externalip:databaseport 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
Jul 10 '08 #3
>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

Jul 14 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by andy.g.ward | last post: by
1 post views Thread by James Pannozzi | last post: by
21 posts views Thread by Strath-Clyde | last post: by
1 post views Thread by sam | last post: by
3 posts views Thread by Ron | last post: by
3 posts views Thread by Weston Fryatt | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.