|
-
Apr 29th, 2007, 10:05 AM
#1
Thread Starter
New Member
-
Apr 29th, 2007, 12:07 PM
#2
Frenzied Member
Re: Data Readers
con.Open;
dr = com.ExecuteReader();
While(dr.Read()) {
comboBox.Items.Add(dr!CustomerID);
}
con.Close();
(not sure about this one though): con = null;
"Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
- Zack de la Rocha
Hear me roar.
-
Apr 29th, 2007, 07:53 PM
#3
Re: Data Readers
This:
vb Code:
con = Nothing 'Release object
does not do what you think it does. You should be doing this:Also, I'm not 100% sure that C# supports this notation:If it does then cool, but if it doesn't then use this:
-
Apr 29th, 2007, 08:33 PM
#4
Re: Data Readers
Shouldn't that be dr["CustomerID"]?
-
Apr 29th, 2007, 09:35 PM
#5
Re: Data Readers
 Originally Posted by penagate
Shouldn't that be dr["CustomerID"]?
Indeed.
-
May 1st, 2007, 03:29 AM
#6
New Member
Re: Data Readers
Thanks guys. I will give some of these a go.
PS Never like database programming the best of times.
-
May 1st, 2007, 07:55 AM
#7
Re: Data Readers
I used to hate database programming but really it's mostly because libraries insist on making it more complicated than necessary. .NET provides a large array of classes to ease data access but it can be hard to decide which ones you need (in other words, it almost provides too many). Once you get the hang of creating a basic data access layer you realise it's very simple and you can follow the same patterns in many of your applications.
-
May 1st, 2007, 08:54 AM
#8
New Member
Re: Data Readers
Allot advice down under. Cheers!
PS I'm from England by the way.
-
May 1st, 2007, 06:27 PM
#9
Re: Data Readers
Are you aware that you created and replied to this thread using two different user names?
-
May 2nd, 2007, 04:34 PM
#10
Thread Starter
New Member
Re: Data Readers
Indeed, had some internet problems along with email problems as well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|