Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 24th, 2005, 03:43 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help, trying to fill grid w/database items

Hi everyone, I am new

(Visual Basic) I am having a problem loading data into data grid on my form in Visual Studio from an Access db. Here is the line of code:

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        DsStudent1.Clear()
        OleDbDataAdapter1.Fill(DsStudent1)

When I try to run it I get:

 An unhandled exception of type 'system.Data.OleDb.OleDbException
occured in system.data.dll

That last line of code is highlighted in debug mode

I've got my connection, adapter, and dataset.i have tested my connection and it works. I have set the data source and data members correctly to my ds. When I go to Preview Data, then click fill data set, it works fine. Just won't load to form. Tried using a button instead but still nothing. I am pretty positive that my steps to connect are right.

I am using the Jet 4.0 provider as directed by my teacher. Could it have something to do with the MSDE? I can't so much locate it on my machine. I thought I had it but after looking, couldn't find it, so I downloaded it from microsoft. But still no luck. I bet it is something easy, but I have spent sooooo many hours trying to figure it out

Quick replies are so very much appreciated. Thanks sooooooooooo much

~C


Reply With Quote
  #2 (permalink)  
Old May 24th, 2005, 10:57 PM
Friend of Wrox
Points: 3,558, Level: 25
Points: 3,558, Level: 25 Points: 3,558, Level: 25 Points: 3,558, Level: 25
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: California, USA
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

Dear friend u fill dataSet by an Adapter & its OK!
but u should bind ur Data to ur Grid so do as:

this.dataGrid1.DataSource = this.DsStudent1;
this.dataGrid1.DataMember = "urDataTableName";

HTH.

Always:),
Hovik Melkomian.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to EDIT,delete,add,items in my database zedekiah BOOK: Beginning ASP 3.0 2 May 15th, 2008 08:16 AM
How to fill a combobox with the items from a query MacDevv C# 1 August 21st, 2006 07:59 AM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
Listing and limiting items from a database RPG SEARCH ASP.NET 1.0 and 1.1 Basics 11 August 3rd, 2004 04:37 PM
displaying items from a database?? Ashleek007 PHP Databases 3 April 27th, 2004 06:05 PM



All times are GMT -4. The time now is 12:53 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.