473,385 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1841
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: David | last post by:
Hi everyone, I have a ActiveX EXE component written in VB6. This ActiveX EXE exposes various public methods that can be called by several other independent Windows EXE applications (also written...
2
by: Berata | last post by:
Hello all, in VB6 we were able to create ActiveX-DLL's (In Process Components) and ActiveX-Exe's (Out of Process Components). We habe build up an application that exists of an main module...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
1
by: James Pannozzi | last post by:
I'm just starting a C++ application which will send data to someone else's program (written as a VB ActiveX COM app) and receive some data back from it. I have the Visual Studio .NET 2003...
21
by: Strath-Clyde | last post by:
I'm a die hard c# developer, developing win32 and web based enterprise apps for last few years. The development team I'm on is going down a path I feel is wrong. I scoping out the web to knock...
1
by: sam | last post by:
Guys, I was trying to use an activeX control that communicate with Scales in a web application, i could add the control in the design mode and it even works as expected. But, i need to access it...
3
by: Ron | last post by:
Hello, I need project2 to communicate with project1. I usd to do this in VB6 where Project1 was an ActiveX app and Project2 was a regular exe. Project1 runs 24/7. Project1 invokes project2...
3
by: Weston Fryatt | last post by:
I have a custom written ActiveX Control (written in VC++ 7 unmanaged) that is embedded on a web page, I need to be able to send events (like button click and toolbar clicks) from the ActiveX...
13
by: Wade Yin | last post by:
Hi, If I can write a ActiveX component that can support socket communication in webpage, that will make browser have strongger capability to communicate with different clients, but not only can...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.