If you like "code based", then check out a few of these samples:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!140.entry
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!139.entry
The 1.1 is a letter better put together, but the 2.0 version works good as
well.
I would look up the EnterpriseLibrary.Data (and if you get my samples above,
you should replace SqlHelper calls with EnterpriseLibrary.Data calls )
This is a pretty good sample
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!158.entry
of using the EnterpriseLibrary, you just need to whack out the WCF stuff
probably.
When you use the EnterpriseLibrary, you start seeing VERY clean code like
this:
private readonly string PROC_ZEBRA_GET_ALL =
"[dbo].[uspZebraGetAll]";
public IDataReader ZebraGetAll()
{
IDataReader idr = null;
try
{
Database db = base.GetDatabase();//base code is in the
download
DbCommand dbc =
db.GetStoredProcCommand(this.PROC_ZEBRA_GET_ALL);
idr = db.ExecuteReader (dbc);
return idr;
}
finally
{
}
}
All url's above have downloadable code.....you just gotta find the link.
Rule #1
ADO.Net is not ADO.
#2 Do not create ADODB objects in dotnet code. (If you use an upgrade
wizard, you might get this).
Google
IDataReader LoadDataSet
and you'll find alot of info.
The code is in C#, but easily translatable. Also, if you translate, you'll
really see whats going on as your replicate the project into another dotNet
language.
"Paul" <Pa**@discussions.microsoft.comwrote in message
news:1A**********************************@microsof t.com...
Hi everyone,
I'm a VB6 developer who has recently installed Visual Studio 2005 and I
want
to get my hands dirty with VB.NET 2005! I'm struggling with database
connections, and I mean floundering!
Most of the examples I've found have been using forms and controls but I
would like to do it all in code. You could set up a connection and
recordset
very easily in classic ADO so I don't suppose it's that hard but I'm
stuck.
All I want to do is create a connection to a SQL database, query a table
(any
table) and then set the value of a string variable with the value of a
field
in my returned records.
Can anyone give me a basic example to set me on my way?
I would really appreciate it.
Thanks in advance for any help
Paul