Database access sucks!

  • Thread starter Thread starter Relaxin
  • Start date Start date
Relaxin said:
It is just me or has MS created some of the worst ways to access and
display data?

You can use a DataSet, but if you want to sort or filter the data to must
use a DataView which is created from a DataSet.

Here's what I ended up doing.

For more complex data tasks, instead of using a DataReader ( forward only,
no search ) or DataView ( no sort, no search ) when I need to manipulate
and change the data locally, I run a sql command as xml, and load it into
an XmlDocument.

It's disconnected.

It has latency.

And I can search ( and update it ) using XPath queries.

If I want to update the database with changes, no problem either.

XmlDocument does all the things that DataReader and DataSet don't do well.

--
"The Bush administration aims in its 2005 budget to cut by $1 billion the
$18 billion fund that helps about 2 million Americans--generally the poor,
elderly, and disabled--pay their rent."
-Mother Jones
http://www.motherjones.com/news/dailymojo/2004/05/05_520.html
 
interesting.

Dataset can be easily converted to an XML document, and back to a Dataset
for update.

Sounds like you've made extra work for yourself.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
Section 8,

To say this in a different tone, I want to say that you have to see the
dataset concept in its complete view. It is a part of System.Data where
derives from the classes Dataset DataTable DataColumn DataView
DataViewManager. This can in my opinion not be seen from one class alone as
the DataSet.

All of those classes have very strong methods and properties, while the only
thing which in my opinion are maybe still not strong enough are the public
events, however they are there and some very usefull.

To take the dataset again apart, one of the methods is the writeXML which is
a very overloaded method, (what most methods from system.data are). The
writeXML is not only usable to write to disk, however as it seems for me,
to endless streams and with that even easy to use.

Cor
 
Well, then you might need to redesign your app - maybe you don't need
to select ALL the records INCLUDING the pictures! Maybe just rewrite
your app to select FEWER records, and leave the images in the DB,
until you REALLY need them.

Heck, it's not ALWAYS MS's fault when your system is designed badly!

Just the answer I would expect from a MS junkie.

If I want to cache all the records to the client then MS should allow me
that option, if I need a live connection, that option should be a available
also.
Those were the options available to me with OLEDB.

MS shouldn't dictate to me how I should write my application, but should
give me the option to write it the way that "I" need it written.

Also remember, that just because you don't know my design doesn't mean its
bad, it just means you are a closed minded developer that thinks thier way
is the only way.
That's MS junkie thinking.
 
Relaxin said:
Just the answer I would expect from a MS junkie.

While it is unclear if the recepient of that comment would consider it an
insult, it is clear to me that you intended to insult him. Let's keep a
cool head and discuss technology, OK?

If I want to cache all the records to the client then MS should allow me
that option,

why? If you are referring to server-side cursors, the option created
unscalable applications. It was only intended for very narrow uses, and was
nearly always misused by lazy developers creating apps that were not stress
tested before being inflicted on the general public. Those apps were so bad
that they gave MS technology a bad name, because they kept failing under
stress. Other database access methods don't allow this goofy design, and MS
probably shouldn't have either. Sometimes, when you release a technology,
it is hard to see how it will be used or misused. When you realize the
mistake, you take responsibility, correct it, and move on. The product
group did the right thing by turning the spotlight away from this idea.
if I need a live connection, that option should be a available

You have it. DataReader is a live connection. If by "live connection" you
are referring to rowsets, you have to realize that this was another wildly
misused "feature". It is rarely beneficial to use them and most apps that
used them did so at their own peril.
Those were the options available to me with OLEDB.

And you can still use OLEDB if you want. No one is stopping you. It works
just as well under .Net as it did under COM.
MS shouldn't dictate to me how I should write my application, but should
give me the option to write it the way that "I" need it written.

With power comes responsibility to know how to use it. While your tools
should provide power, they should also relieve the burden of learning. In
other words, they should lead you to make good decisions. The OLEDB tools
led to some decisions, not all of them were good. Apparently, you are
rather attached to some of your decisions, but that doesn't make them good
ones.
Also remember, that just because you don't know my design doesn't mean its
bad,

True. However, you have revealed quite a bit about your design in this
series of threads. From what you have revealed, a few very simple
modifications to your design would allow it to work more efficiently and
much more scalably. Is it wrong to point that out? I'm not defending the
previous poster for his emphasis (which was a bit condescending), but I do
agree that a NG is a place for open discussion, even if it means discussion
of design decisions on your part.
it just means you are a closed minded developer that thinks thier way
is the only way.
That's MS junkie thinking.

Don't be quick to throw stones, friend. In this discussion, who among us
has shown an unwillingness to admit when a design is using tools in a sloppy
manner to accomplish a goal that shows a strong lack of understanding of
efficient or effective data access. That unwillingness has led to much of
the frustration that is coming out.

Perhaps, if you listen carefully, you may hear the sound of people who want
to help you.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
Nick said:
interesting.

Dataset can be easily converted to an XML document, and back to a Dataset
for update.

No, I mean to say, that's what I do.

But I do my manipulations and searching on XML using XPath, because
there are no equivalent methods with DataSet/DataReader.
 
Hi Moe,

Are you also "Section 8"?

Because the original message from Section 8 said that he or she would run a
SQL query AS XML (my emphasis added).

There's a feature of SQL Server that uses the keywords 'AS XML' to direct
the server to return XML in the resultset. I thought that you were
referring to that.

If you are, in fact, using AS XML, then I wonder why not just use the
Dataset object, serialize to XML, manipulate it there as you see fit,
deserialize back to dataset and then use a data adapter to make the updates.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
Other database access methods don't allow this goofy design, and MS
probably shouldn't have either.
I'm not sure what DB you are talking about, by the DB's Ive used, all have
that capability (except Firebird).

If you are referring to server-side cursors, the option created
unscalable applications.
My application scaled just fine for my needs and my customers love it.
Again, don't assume you know my application based off of how you design your
systems.

With power comes responsibility to know how to use it. While your tools
should provide power, they should also relieve the burden of learning.
Have you looked at C and C++, they have power but it made no effort in
relieving the burden of learning.
That's the way I like it, give me the power and it's up to me to learn it.

..NET has made some things easier, but it's has removed some of the power
that C++ developers want.
 
Just the answer I would expect from a MS junkie.

I'm no MS junkie by any means - but I just think lots of developers
always insist that THEIR way is the only way to go, and MS better
support it - period.

Well, you gotta put yourself into MS' shoes, too, at times - they have
to design basic infrastructure code that will cover most needs of the
largest possible group of developers, and at the same time, everyone
expects MS to provide guidance in terms of best practices and so
forth. This isn't an easy place to be, either.

And yes, of course, MS could

a) design the system so that it will cover ALL imaginable scenarios -
when do you expect that to ship then??

b) make sure ANY vintage technology still works tens generations later
- welcome to messy APi's and stuff
Those were the options available to me with OLEDB.

Yes - those were the days. The good old days when everything was
better.

Things change - in life, and especially in IT - get used to it, and
DEAL with it - or get out of this business.
MS shouldn't dictate to me how I should write my application, but should
give me the option to write it the way that "I" need it written.

Well, in that case - just stick to VB6 and OleDB then - no one FORCES
you to use ADO.NET by any means!
Also remember, that just because you don't know my design doesn't mean its
bad,

No - but just because your design USED to work (more or less) in OleDB
doesn't mean that it's good and suitable for today's way of doing
things, either! In the vast majority of cases, the fault or flaw
doesn't really exist in the "system" (like ADO.NET), but in the flawed
designs people try to coerce on top of the system (without
understanding the basics and workings of that system).

I just say "in general" - I don't know you, or your design - but I'm
just saying took a good look at it - most often you can fairly easily
make it a whole lot better, and get better results, rather than trying
to force your "old" design onto a new system not intended for that
kind of use.

Marc
================================================================
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch
 
Nick, I have to address one of your statements about "lazy developers"
misusing server side cursors. In VB6 DAO recordsets the default was client
side cursors, when ADO was introduced the default was server side cursors.
If you were testing in a small shop on a fast LAN the response time is barely
noticable. I think the problem is that the default in ADO should have been
client side cursors. This probaply lead to the scalability problems more
than programmer *laziness*.

I'm sure there were many programmers out there that did not notice the
difference until they rolled out into a different environment.

Cheers
 
You are using the wrong class. You should be using a datareader if you need
a connected resultset. If you read the description of the class right out of
the documentation, it clearly states that datasets are disconnected. There
is no ambiguity here.

I am really impressed with the people in this newsgroup and the effort that
they are making to try to help you. However to be honest it doesn't seem
like you are here to get help... just to complain. I suggest that instead of
wasting everybodies time here, you should go and actually *READ* the
documentation and try to understand it, instead of using Intellisense to
write code.
 
If you would have read the entire thread, you would have seen that what I
need is a connected DataSet.

I need the power of the DataSet but in a connected manner, the way OLEDB
allowed.

So stop wasting my time.
 
you are right... it isn't necessarily the developer's fault. The tools
changed in a subtle way and that caused some problems.

I apologize for implying otherwise.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
The only problem with this statement is that, the "database" still provides
this functionality (keyset, dynamic, forwardonly, etc) and is available to
anyone NOT using .NET, they only removed it from the .NET language.

So Microsoft did not remove anything, they just didn't add it to .NET.

So my point would be...if using it in a certain way causes you problems,
then change it to something that is more suitable. You should be given
access to it if you need, it shouldn't have been left out of .NET just
because "some" developers were having problems. That was the beauty of
OLEDB, you had other options to choose from if the one you were using wasn't
working for you.

The way it stands now you have no options.
 
Dude, chill. Its just that you are learning a totally new framework that
uses terms similar to VCL but aren't VCL objects. Once you get past that,
you can start to move forward learning the new framework.

Incidently, coming from a strong Delphi background, I can tell you that
Borland's solutions aren't nearly as flexible, but that the stock visual
controls all pretty much stink. Do what you did with borland, go find a
quality replacement.

And as for borland's 'quality' tools, I point you to dbExpress (fatally
flawed and a total 180 on previous db technologies they provided)

Give it a chance to learn the new dotNet framework without carrying forward
VCL expectations and it will go easier!
 
I didn't use dbExpress, I rolled my own.

But you must be on drugs to think that .NET tools are better than
Borland's!!

I have learned dotNet in the hope that it would be better or even on the
same level as Borland, but to my disappointment, it's much worst.
But since MS is changing the canvas, I believe I am forced to paint with
this delapitated brush known as dotNet.

I'm still hopeful that they will get it right, version 2.0 looks
interesting, but still lack some important features.

Such as proper/better handling of resources by the garbage collector.
 
IT'S NOT JUST YOU!

1.) The DataGrid is a piece of 5h1t. Once you sort it, all bets are off. And
if you want to highlight a row (or cell)... fuggedaboutit. It is much cheaper
to buy a grid that doesn't suck than to try to make the MS DataGrid do what
the old grid (as in VB6) used to do (out of the box).

2.) Is ADO.NET better or worse than OLEDB? I hated it at first (mostly
because I was using it with the DataGrid) but now I am used to it and it
works fine. Was it a pain in neck to learn? Sure... but if this job was easy,
anybody could do it and it wouldn't pay as much.

3.) Resistance is futile.
 
Relaxin,

Man you just are not getting what ADO.NET is about are you. ADO.NET
first of all has nothing to do with the gatagrid, looks like your beef
lies with the winforms controls not ADO.NET. I myself am sometimes
frustrated with the datagrid control. The good news is that the
datagrid control has been completely revamped in the next revision of
the framework.

I work for a company which provides .NET training and a lot of people
have trouble transitioning from traditional programming concepts to .Net
concepts. Looks like you need a good understanding of what ADO.NET
provides and what it's role is in an application.

Forward only, keyset, etc have no place in datasets. How exactly would
you use a forward only dataset? A dataset is not a bound by a
connection to the db and does not behave like a recordset did in
previous programming frameworks.

I suggest you take the time to grasp what ADO.NET is before you make
suggestions on how it could be improved.

Sincerely,
Richard N.
 
All of what you said, I already know.
Forward only, keyset, etc have no place in datasets. How exactly would
you use a forward only dataset?

I wouldn't use a forward only dataset, but I sure as heck would use a
keyset.
I suggest you take the time to grasp what ADO.NET is before you make
suggestions on how it could be improved.

I fully understand ADO.NET. I'm only griping about things that I need, that
it lacks.

If you could explain to me how to get what I'm looking for, then I would
could concede that I need to get a bit more understanding about ADO.NET
under my belt.
But if you can't, then don't assume that I don't know it...assume that I do
know it.

Thanks
 
Back
Top