How do I stop VS2005 from backward-quoting identifiers on updatestatements?

  • Thread starter Thread starter Heinz Kiosk
  • Start date Start date
H

Heinz Kiosk

I'm using the VS2005 wizard/design tool for generating typed
datatables and adapters for a desktop application. At design-time I
point the development environment at an MSJet database, but I've been
careful to make all of the queries that I add to the adapters generic
SQL which should work against most environments (or at least MS SQL
Server, which I also want to target)

BUT, the update/insert/delete statements that are being handily
generated by the wizard are cloaking all of the identifiers with
backward quotes which work OK with MSJet but not when I shift the
connection to MS SQL Server at run time. Is there any way of stopping
that backward-quoting behaviour at design time? I cannot see it...
 
You won't have much luck writing an application that can access JET and any
other DBMS. This has been discussed a million times so hit Google or one of
(any of) my books.
--
__________________________________________________________________________
William R. Vaughn
President and Founder Beta V Corporation
Author, Mentor, Dad, Grandpa
Microsoft MVP
(425) 556-9205 (Pacific time)
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
____________________________________________________________________________________________
 
William said:
You won't have much luck writing an application that can access JET and
any other DBMS. This has been discussed a million times so hit Google or
one of (any of) my books.

Thanks for the response, it is better than silence, BUTTTT er.....


Since I've written commercially successful apps previously that worked
against both of those two platforms I'm not exactly inspired by your
comment to go out and buy your books... Pretty much everything but the
automatically generated updates from the VS generated classes is already
working on both platforms in this app. I'm aware of the issues, and I've
coded in a style that gets around them. I really just use SQL server as
a data table repository so that I get better multi-user scalability at
the 5-10 user level than Jet provides. The app doesn't have large
requirements and I make sure that all queries (both views and adapter
selects) use sufficiently generic SQL. Where necessary I recode the
views per platform because they exist independently of the program code
and therefore that portion of the app doesn't need a single codebase.

So thank you, but does anyone actually have an answer to the question?


Tom
 
So thank you, but does anyone actually have an answer to the question?

Wizards are great up to a point. It sounds like you've reached that
point. Which means you should consider a non-wizard approach like
most serious developers do when they reach "that point" with every
wizard that has ever comes with VS.

Michael O
http://blog.crisatunity.com
 
Michael said:
Wizards are great up to a point. It sounds like you've reached that
point. Which means you should consider a non-wizard approach like
most serious developers do when they reach "that point" with every
wizard that has ever comes with VS.

Michael O
http://blog.crisatunity.com

Thank you.

That used to be the view I took too. But I've found this particular
wizard (which I use in design mode rather than the wizard mode) to be
extremely useful. I'd have to write an awful lot of code to replace it
effectively and 18 months into this particular project which has already
shipped to thousands of MSJET sites this one issue with the MSSQL port
is the first significant problem *I've* had with it.

Similarly I find the winforms design tool to be an improvement to me
writing scads of code that places my controls and sets their attributes
by hand. It depends what kind of app you're writing I guess. In the past
I've written dynamic forms where the dialog designer is largely useless,
and I've implemented dynamic data requirements where the VS generated
strongly typed dataset would be useless. That doesn't make either of
those things useless in every case. I'm just mildly surprised that the
strongly typed dataset targets its generated code so strongly at the
design-time db technology when it isn't necessary for it to do that.

I already heavily customise the wizard's code with my own partial class
implementations of the datarows for business logic (the app doesn't
require an n-tier strategy) and also some minor (no brain) adjustments
of the adapters to make them work well with transactions. In fact every
adapter has a custom constructer added which is the one that I always
call, so for the moment I'll add a single line to each of those
constructors that calls a helper function to remove the apostrophes from
the 3 generated update statements. A bit kludgy, but I expect it will
work. THinking about it I've already used this style of solution
unconciously for other issues with the strongly typed datasets. It was
just the mildly surprising nature of this particular issue that made me
ask the question.

Thanks anyway.

Tom (Heinz)
 
Back
Top