[dba-VB] Ado.net 2.0

John Colby jwcolby at ColbyConsulting.com
Sat Dec 31 10:37:45 CST 2005


I am having a hard time getting started with ADO.net 2.0.  I need example
code for SOMETHING (anything) that looks up data in a table, preferably in
an sql server db.

As an example, I have a the "login form" that the wizard builds in VB.Net
2.0.  It has two text boxes for username and password, and an OK and Cancel
button.  No code.

I have a user table in a SQL Server database, with a UserName and
PasswordHash field.

I need to accept the user's input of the username and look it up in the user
table in the SQL, retrieving the passwordhash.

I can do everything except get the data.  Frustrating.  I could do it in 1.x
(which still works) but I understand that there is a
"newer/better/faster/easier" way to do this stuff in 2.0.  The only problem
is getting examples.  As you probably know all anyone is interested in is
binding controls to data which isn't what I want.  I need to know how to do
it all in code.

Eventually (soon thereafter) I will want to pull an entire set of tables,
iterating the tables, populating classes with the data in the tables.  The
data in the classes will be changing so I need the classes to be able to
write the data back out to the tables as well.  Again, what I need in this
instance is an example, from the start, of dimming all of the objects
required, then reading data out of a given table, and writing data back into
that same table.

If anyone has example code that they wrote, or a web page that does this
programmatic manipulation, from start to finish, I would be forever
grateful.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/




More information about the dba-VB mailing list