473,396 Members | 1,852 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,396 software developers and data experts.

Strategy / direction?

Hi All, wonder if anyone can help me with some direction...
I'm a VB6er who has been plunged into the VB.NET arena with a requirement to
complete a reasonably small project within a month..

The basics are.. I have two databases, from 3rd-party suppliers for which
there is somewhat common data that I have to 'unite' using a simple
interface, enabling the end-user to report on the combined information from
both.

Both databases are Access; the data is 'open' in one, and the data in the
other is accesible via a dll/reference supplied by the vendor of the
software/database.

My plan is to create a 3rd database - a transaction-store, which essentially
keeps a cross-reference of records in comparable tables in the two 3rd-party
databases. A user-driven function will scan one database, and check for any
new records that don't have a matching record in the transaction-store,
these records are then presented to the user who will go then match them
with records in the other 3rd-party database. These new matches are then
added to the transaction-store database.

Now, in VB6, I could have written some quite offensive code, that would
essentially read the first table, then read the transaction-store for
existence, and added records as necessary....

Looking at VB.NET, I see that we have some wonderful ways to set
relationships in the data programmatically. Could I use this to my
advantage? If so, any code examples handy? - nothing too indepth, but any
pointers in the right direction would be greatly appreciated....

Basically, any ideas you guys have, I'd be interested in hearing... as I
say, I'm new to .NET have a number of books to read, but need to start
producing on this pretty quickly and could do with a jump-start..

Thanks,
Graham
Jul 21 '05 #1
5 1267
Hi Graham,
How come you don't want to use SQL statements to combined the data into
a data set that you need at run time? It would be easier then try to
replicate the two into one and then try to keep the data in sync.


"Graham Blandford" <gr**************@sympatico.ca> wrote in message
news:ze*********************@news20.bellglobal.com ...
Hi All, wonder if anyone can help me with some direction...
I'm a VB6er who has been plunged into the VB.NET arena with a requirement to complete a reasonably small project within a month..

The basics are.. I have two databases, from 3rd-party suppliers for which
there is somewhat common data that I have to 'unite' using a simple
interface, enabling the end-user to report on the combined information from both.

Both databases are Access; the data is 'open' in one, and the data in the
other is accesible via a dll/reference supplied by the vendor of the
software/database.

My plan is to create a 3rd database - a transaction-store, which essentially keeps a cross-reference of records in comparable tables in the two 3rd-party databases. A user-driven function will scan one database, and check for any new records that don't have a matching record in the transaction-store,
these records are then presented to the user who will go then match them
with records in the other 3rd-party database. These new matches are then
added to the transaction-store database.

Now, in VB6, I could have written some quite offensive code, that would
essentially read the first table, then read the transaction-store for
existence, and added records as necessary....

Looking at VB.NET, I see that we have some wonderful ways to set
relationships in the data programmatically. Could I use this to my
advantage? If so, any code examples handy? - nothing too indepth, but any
pointers in the right direction would be greatly appreciated....

Basically, any ideas you guys have, I'd be interested in hearing... as I
say, I'm new to .NET have a number of books to read, but need to start
producing on this pretty quickly and could do with a jump-start..

Thanks,
Graham

Jul 21 '05 #2
Hi Graham
"Graham Blandford" <gr**************@sympatico.ca> wrote in message
news:ze*********************@news20.bellglobal.com ...
Hi All, wonder if anyone can help me with some direction...
I'm a VB6er who has been plunged into the VB.NET arena with a requirement to complete a reasonably small project within a month..
Plenty of time for any db app with .NET ;-)
The basics are.. I have two databases, from 3rd-party suppliers for which
there is somewhat common data that I have to 'unite' using a simple
interface, enabling the end-user to report on the combined information from both.
I can't tell if the requirement is that these two old dbs are to stay in use
w/ other apps or if you simply need to use them for the data but once you
get them migrated you can say good bye to them forever. Either way you have
a pretty straightforward task. I'll explain below:
Both databases are Access; the data is 'open' in one, and the data in the
other is accesible via a dll/reference supplied by the vendor of the
software/database.

My plan is to create a 3rd database - a transaction-store, which essentially keeps a cross-reference of records in comparable tables in the two 3rd-party databases. A user-driven function will scan one database, and check for any new records that don't have a matching record in the transaction-store,
these records are then presented to the user who will go then match them
with records in the other 3rd-party database. These new matches are then
added to the transaction-store database.

Now, in VB6, I could have written some quite offensive code, that would
essentially read the first table, then read the transaction-store for
existence, and added records as necessary....

Looking at VB.NET, I see that we have some wonderful ways to set
relationships in the data programmatically. Could I use this to my
advantage? If so, any code examples handy? - nothing too indepth, but any
pointers in the right direction would be greatly appreciated.... I'm going to make a few assumptions for the sake of illustration but nothign
would change if the assumptions were changed. Let's assume that both db's
have the same fields/same schemas or if not, that they are similar enough
that mapping them to a new db would be doable.

Remember that the ADO.NET metaphor is that a DataSet is roughly analagous to
a Database. A datatable is roughly analogous to a Table in that db. A
dataview is roughly equivalent to a view in a Db. A Dataset is simply a
collection of db objects, which at a minimum are 0 or more datatables.
DataTables can be bound to each other through DataRelations - these can be
defined at design time w/ Strongly typed datasets or at runtime
http://www.knowdotnet.com/articles/datarelation.html. Now, in general
strong typing is the way to go and STD's are the way to go - however if you
don't know the fields in advance, Strongly Typed Datasets (STD) don't lend
themselves well to this. Anyway, the DataAdapter object is responsible for
marshalling data back and forth. They DONT care where the data came from
and they don't care where it's going as long as the data they are moving
matches the command object for the respective command. So, lets say that
you have 100 records in table1 which has fields A, B, and C. In table 2 you
have fields A,B, C, D and E. You can use one dataadapter to fill a
datatable (dt - which is a table in a dataset dS). Now the select command
for table1 would look like Select A, B, C from Table_1. Then you'd call
fill like this OleDbDataAdapter1.Fill(ds, dt) Ok, as it stands, the
rowstate of each of the rows is 'unchanged' which means that when we call
update, it will loop through the datatable and for every row with a rowstate
of Added, it will use that row and fire the Insert Command specified in the
adapter. For each rowstate of Modified it will use the Update command. For
each row with a rowstate of Deleted it will use the delete command. Since
we don't have any changes, nothing will happen. However, if we set the
AcceptChangesDuringFill property of the adapter to false
http://www.knowdotnet.com/articles/datasetmerge.html Then all of the rows
will have a rowstate of Added. Thus, if we call update on another adapter,
each row will be treated just like it was a new row added to the set. So,
if we had OleDbDataAdapter2 and it's Insert command used only fields A, B,
and C, we could call OleDbDataAdapter2.Update(ds.Tables[0]) //tables 0 is
dt. This would effectively insert each value into the Table2. We could
also create two datatables and perhaps use merge, or add a third DataColumn
so that table1 matched 2 and use all four columns for the update. Also, you
need to use keyed tables for updates (keys on the backend at a minimum) but
you can define your own keys
http://www.knowdotnet.com/articles/dataviewspart2.html and relations that
may or may not exist on the backend. You even have .AutoIncrement
properties and a Seed and everythign.

Anyway, you can easily use both datasources to fill a datatable (yes, you
can fill one datatable with two different adapters from two (or more)
different datasources as long as the schemas match (or have something in
common - you can make them be exact or you can allow it to be forgiving to
some degreee). Now, remember that rowstate is everything. So you have all
of this data (remember the AcceptChangesDuringFill should be false if you
want these rows to be inserted into the destination) from two separate
sources in one or two datatables (say one for this). Now you can call
OleDbDataAdapter3.Update(ds.Tables[0]) or
OleDbDataAdapter3.Update(ds.Tables[0]); then call
OleDbDataAdapter3.Update(ds.Tables[1]); if we used two tables instead of
one. If you configured everything correctly, you'll have all of your data
and the modifications you made to it in the destination datasource.

This end source can be XML (you can use
DataSetName.WriteXML(@"Path:\file.xml"); to write out your data and the
inverse dataSetName.ReadXML(@"Path:\file.xml"); to deserialize things

If you look at the Data Access section of www.knowdotnet.com
http://www.knowdotnet.com/dataaccess.html I've written a fair amount of
stuff (I mention it b/c it's mine but that's in no way implying it's a
definitive site).

Bill Vaughn's www.betav.com has some of the best articles ever written on
ADO.NET, pure gold. You'll find his book(s) there too which is in a first
place tie for best ADO.NET book written. The other book is David Sceppa's
ADO.NET Core Reference. Don't leave home without either of them.

Another thing you may want to look into is System.XML and XML web services.
XML isn't the fastest way to access data but it's powerful and if you aren't
resource constrained, it offers some killer solutions.

There are many sites like www.c-sharpcorner.com that have some great
DataAccess content, of course www.dotnetjunkies.com / www.sqljunkies.com ,
www.gotdotnet.com , www.brains-n-brawn.com just to name a few. Also there
is a ton of great stuff in this NG. This is without a doubt my favorite NG
and it's because the topics are always interesting and there's some really
amazingly talented folks here.

Hopefully this is enough to get you started but if you need any help or have
any questions, please don't hesitate to ask.

Cheers,

Bill


Basically, any ideas you guys have, I'd be interested in hearing... as I
say, I'm new to .NET have a number of books to read, but need to start
producing on this pretty quickly and could do with a jump-start..

Thanks,
Graham


--
W.G. Ryan MVP Windows - Embedded

www.devbuzz.com
www.knowdotnet.com
http://www.msmvps.com/williamryan/
Jul 21 '05 #3
guy
Hi,
Well you could thump your bosses for being unreasonable;-)
moving from VB6 to VB.Net s a *** big *** change (but definitely worth it!)
as nbk implies do as much as you can at the database level, and if performance is critical use a datareader not datasets - but this depends to some degree on wether it is a Winforms or Webforms app...
so much to learn...
As I say a BIG change and lots of fun(?) learning.
probabaly the most iportant thing is to get the idea across to your bosses the idea that VB6-VB.NET is NOTHING like VB5-> VB6

hth guy

Jul 21 '05 #4
Thanks for your help guys.
Lots of useful things in there for me to investigate...

The .NET thing has been thrown into the mix purely because the dll/reference
for accessing one of the databases is a .NET component and can't be used in
VB6 - the database is locked up by the 3rd-party company who won't allow any
direct access to their db... so.. read only it is....hence the requirement
to develop in .NET and the aggresive time-frame to learn...

Once again, thanks for the insights and I'm sure you'll be seeing my posts
more regularly in the very near-future.... ;)

Graham

"Graham Blandford" <gr**************@sympatico.ca> wrote in message
news:ze*********************@news20.bellglobal.com ...
Hi All, wonder if anyone can help me with some direction...
I'm a VB6er who has been plunged into the VB.NET arena with a requirement to complete a reasonably small project within a month..

The basics are.. I have two databases, from 3rd-party suppliers for which
there is somewhat common data that I have to 'unite' using a simple
interface, enabling the end-user to report on the combined information from both.

Both databases are Access; the data is 'open' in one, and the data in the
other is accesible via a dll/reference supplied by the vendor of the
software/database.

My plan is to create a 3rd database - a transaction-store, which essentially keeps a cross-reference of records in comparable tables in the two 3rd-party databases. A user-driven function will scan one database, and check for any new records that don't have a matching record in the transaction-store,
these records are then presented to the user who will go then match them
with records in the other 3rd-party database. These new matches are then
added to the transaction-store database.

Now, in VB6, I could have written some quite offensive code, that would
essentially read the first table, then read the transaction-store for
existence, and added records as necessary....

Looking at VB.NET, I see that we have some wonderful ways to set
relationships in the data programmatically. Could I use this to my
advantage? If so, any code examples handy? - nothing too indepth, but any
pointers in the right direction would be greatly appreciated....

Basically, any ideas you guys have, I'd be interested in hearing... as I
say, I'm new to .NET have a number of books to read, but need to start
producing on this pretty quickly and could do with a jump-start..

Thanks,
Graham

Jul 21 '05 #5
What you are saying then is that the third party has supplied a .NET
assembly (the DLL). This isn't something I know how to do off the top of my
head but I do know that you can quite easily produce a COM wrapper around a
..NET assembly. If it would help your time to market this might be a better
option; producing a COM wrapper around the assembly would for the time being
at least allow you to return to the development environment you love and
write code as you know how.

Just a thought

--
--------------------------------------------------------
Peter Wright (www.petewright.org)
Author of ADO.NET Novice To Pro
From Apress. www.apress.com
"Graham Blandford" <gr**************@sympatico.ca> wrote in message
news:0P*********************@news20.bellglobal.com ...
Thanks for your help guys.
Lots of useful things in there for me to investigate...

The .NET thing has been thrown into the mix purely because the dll/reference for accessing one of the databases is a .NET component and can't be used in VB6 - the database is locked up by the 3rd-party company who won't allow any direct access to their db... so.. read only it is....hence the requirement
to develop in .NET and the aggresive time-frame to learn...

Once again, thanks for the insights and I'm sure you'll be seeing my posts
more regularly in the very near-future.... ;)

Graham

"Graham Blandford" <gr**************@sympatico.ca> wrote in message
news:ze*********************@news20.bellglobal.com ...
Hi All, wonder if anyone can help me with some direction...
I'm a VB6er who has been plunged into the VB.NET arena with a requirement
to
complete a reasonably small project within a month..

The basics are.. I have two databases, from 3rd-party suppliers for

which there is somewhat common data that I have to 'unite' using a simple
interface, enabling the end-user to report on the combined information

from
both.

Both databases are Access; the data is 'open' in one, and the data in the other is accesible via a dll/reference supplied by the vendor of the
software/database.

My plan is to create a 3rd database - a transaction-store, which

essentially
keeps a cross-reference of records in comparable tables in the two

3rd-party
databases. A user-driven function will scan one database, and check for

any
new records that don't have a matching record in the transaction-store,
these records are then presented to the user who will go then match them
with records in the other 3rd-party database. These new matches are then
added to the transaction-store database.

Now, in VB6, I could have written some quite offensive code, that would
essentially read the first table, then read the transaction-store for
existence, and added records as necessary....

Looking at VB.NET, I see that we have some wonderful ways to set
relationships in the data programmatically. Could I use this to my
advantage? If so, any code examples handy? - nothing too indepth, but any pointers in the right direction would be greatly appreciated....

Basically, any ideas you guys have, I'd be interested in hearing... as I
say, I'm new to .NET have a number of books to read, but need to start
producing on this pretty quickly and could do with a jump-start..

Thanks,
Graham


Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ajsiegel | last post by:
Viile writes - >Type declarations are a feature that might benefit IronPython and >Jython more than they would CPython. How much is this part of Guido's decisionmaking process? Guido is ,...
0
by: Robert Oschler | last post by:
I want to have a master table and a detail table. I want the master table record to be created only if one does not exist already for a given account ID. Here is my concern: Let's say I have...
3
by: syncman | last post by:
I think there are 2 options for how to implement the Strategy pattern. One is to use polymorphism; derived classes have the same interface and can be plugged in. The other is to use templates:...
4
by: Claudio Jolowicz | last post by:
I am trying to find a solution to the following design problem (code at the bottom): We are implementing a trader agent that can trade with other traders on an electronical trading platform. To...
0
by: Graham Blandford | last post by:
Hi All, wonder if anyone can help me with some direction... I'm a VB6er who has been plunged into the VB.NET arena with a requirement to complete a reasonably small project within a month.. The...
0
by: KevinMac | last post by:
I'm investigating requirements for deploying applications created for ..NET 2.0 (I've been working with VS2005, C#). One concern I have is granting client PCs code security rights. I know how to...
6
by: Daniel Santa Cruz | last post by:
Hello all, I've been trying to go over my OO Patterns book, and I decided to try to implement them in Python this time around. I figured this would help me learn the language better. Well,...
5
by: pythoncurious | last post by:
Hi python experts In C++ I can do something like this: class Base { public: void f() { this->f_(); } private: virtual void f_() = 0; };
0
by: ltruett | last post by:
I'm almost done my series of design patterns using PHP 5. Today's pattern is the Strategy Pattern. http://www.fluffycat.com/PHP-Design-Patterns/Strategy/ In the Stratedy Pattern a "family of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.