List Info

Thread: Data access techniques




Data access techniques
user name
2006-03-27 00:51:49



Jason,

I won't address all your issues, but I will give you two
things to
consider.

This part of your code:

         cmd.CommandText = "SELECT ClientID, EntityID,
EntryTypeID,
ClientLName, ClientFName, ClientMName, " & _
             "ClientSuffix, SpouseLName, SpouseFName,
SpouseMName,
SpouseSuffix, Inactive FROM ClientAdvantage." & _
             "dbo.Clients WHERE ClientID = "
& intClientID

suggests you may want to read up on parameterised queries /
sql injection.
http://www.4guysfromrolla.com/webtech/092601-1.2.shtml
is as good as place
as any to start.

Also,
http://msdn.microsoft.com/library/d
efault.asp?url=/library/en-us/cpref/html/frlrfsystemdatasqlc
lientsqlcommandclassexecutereadertopic.asp
 suggests you may want to call dr.Read before trying to get
its values.

Seeya
Matthew Wills  MLC
Senior Analyst Programmer

PS. The sample at http://www.4guysfromrolla.com/webtech/092601-1.2.shtml
is
not perfect. sHireDate should probably be declared as a Date
(rather than
String) for example. But it shows the basic idea, and you
can Google for
other samples / discussions.



|---------+---------------------------->
|         |           Jason            |
|         |           <vbdotnetPINEAPP|
|         |           LELANE.COM>      |
|         |                            |
|---------+---------------------------->
 
>--------------------------------------------------------
------------------------------------------------------|
  |                                                         
                                                    |
  |       To:       VBDOTNETDISCUSS.DEVELOP.COM        
                                                        |
  |       cc:                                               
                                                    |
  |       Subject:  [VBDOTNET] Data access techniques       
                                                    |
 
>--------------------------------------------------------
------------------------------------------------------|




Question 1 -- Data access technique: object or code?
I am very new to VB.NET and, specifically, ADO.NET, and am 
coming from the
Access world <sigh>.  In trying to learn about ADO.NET
I have seen that I
can either use "visual" objects that reside in
the system tray for the
connection object, command object, etc., or I can
instantiate these through
code.  Nothing I have seen tells me which is better.  Is
this truly a
matter of preference, or is one technique better than
another?  Which
should I be more interested in learning?

<snip>



____________________________________________________________
__________
This email has been scanned by the MessageLabs Email
Security System.
For more information please visit http://www.messagela
bs.com/email
____________________________________________________________
__________

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com


This e-mail is sent by or on behalf of the named sender
identified above.
If:

(a) you do not wish to receive any e-mail marketing material
from this
person in the future, please forward the contents of this
email to
unsubscribemlc.com.au with the word "unsubscribe" in
the
subject box.

(b) you wish to unsubscribe from all central e-mail
marketing lists
used by our business, please forward the contents of this
e-mail to
unsubscribeallmlc.com.au with the message
"unsubscribe
from all central e-mail marketing lists" in the
subject box.

If you do not forward the contents of this e-mail with your
unsubscription then it may not be able to be implemented.

The information contained in this e-mail communication may
be
confidential. You should only read, disclose, re-transmit,
copy,
distribute, act in reliance on or commercialise the
information if you
are authorised to do so. If you are not the intended
recipient of this
e-mail communication, please immediately notify us by e-mail
to
postmastermlc.com.au, or reply by e-mail direct to the sender
and then
destroy any electronic and paper copy of this message. Any
views
expressed in this e-mail communication are those of the
individual
sender, except where the sender specifically states them to
be the views
of a member of the National Australia Bank Group of
companies. Any
advice contained in this e-mail has been prepared without
taking into
account your objectives, financial situation or needs.
Before acting on
any advice in this e-mail, National Australia Bank Limited
recommends
that you consider whether it is appropriate for your
circumstances. If
this e-mail contains reference to any financial products,
the National
recommends you consider the Product Disclosure Statement
(PDS) or other
disclosure document before making any decisions regarding
any products.
The National Australia Bank Group of companies does not
represent,
warrant or guarantee that the integrity of this
communication has been
maintained nor that the communication is free of errors,
virus or
interference.

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )