 |
| ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application . |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 12th, 2004, 03:56 PM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quickest way to generate data from 1 db to another
hello all, back with another.
Scenario:
Db1: Articles
db2: Stats
What i want to do is grab the top 25 posts from the Articles DB,
and do some statistics like calculate the number of replies, points accumilated, and then generate a rank based on those criteria, then insert the rank and points into a table in the Stats DB.
These two db's are on different servers and different sides of the country for that matter so i basically need to pull data from the Articles DB into a datatable, then do some calculations then insert the resulting set into the stats db. My question is that can anyone suggest the most efficient way of doing this? any psuedo code would be great. I just want to know if there is some .net thing i can do to read from one db, calculate data, then insert results into another db with an entirely new connection.
thanks all
Flyin
|
|

August 12th, 2004, 04:55 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
This has web service written all over it.
Write a web service to serve up the source data, then you can consume it on the other system and insert that data into the other DB.
|
|

August 13th, 2004, 08:43 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
interesting, i'm not too farmiliar with web services so i will look into it. Thank you very much.
|
|

August 13th, 2004, 09:34 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
I agree- since they are so far apart physically a web service would be a good way to go with this. Especially if there is some level of public interenet communication going on...
I am still having this battle with myself, however, on where I should be using a web service- and where I should use another method, like reflection...
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

August 13th, 2004, 09:42 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Here is a side question on performance of web services.
Lets say i have a method that does stats, and again with this same theme, The data needed to populate the stats are on two different servers across the nation.
What are the benefits and performance differences between Retrieving a DataSet of stats
From:
1. A web Service
2. Opening 1 connection, grab the stats then close that connection, then opening the second connection and forwarding the stats on to the second db
3. I don't know much about reflection, so a brief description would be great if one can be met.
JR
|
|

August 13th, 2004, 09:44 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sorry one more quick question,
A main concern about web services that i see off the bat is security, I mean it seems like anyone can consume my data if i don't put permissions on it. Can you give me a tip or two, or even better, because i know this top has been discussed many a time, can you point me to an article that could show me how to easily setup some security on my web service such that only the people i want to see my data can?
Once again sorry for the loaded questions/requests, but when i see good help i try to utilize it!
JR
|
|

August 13th, 2004, 10:14 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
That's a complex set of questions.....
When consuming a web service, or a business object, you work with them (basically) the same way in your program. A web service, is slower, if your dealing with local communication. However, since you are not, the performance is likely to be better- since it uses simple HTTP (if set up that way) to communicate, rather than more complex conection styles of other systems. It's also less prone to problems with things like firewalls geting in the way. Reflection isn't an option here, as it basically involves sending objects back and forth (well, the contents of objects) and is going to be much slower.
As for security, muchas your connections, you need to secure it. Since a webservice runs under IIS, simple security through IIS and NT will secure the system. and since you can do it over HTTPS:// you can have the data encrypted also!
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

August 13th, 2004, 10:18 AM
|
|
Authorized User
|
|
Join Date: Sep 2003
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks for the prompt response. Great, That answers my questions for the time being. I will stop with all the loaded questions now ;) Thanks alot once again!
|
|
 |