Data Source Problem

enzo

New member
Joined
Apr 20, 2010
Messages
4
Programming Experience
1-3
I'm sorry if I posted in the wrong forum. I'm kinda new here.
I'm a student and we have this activity in VB and we have to use the data source.

So I've added a new data source database, made a new connection and used MS Access DB file. It was successful.
I made a new form and dragged the components from the data source into the form.
Image1

But when I ran the program, I wasn't able to browse the records.


I previewed the data and the records were there.


I tried to add records and here's what happens:


I also tried the save button and here's what happens:
Image4

My classmates did the same in their PCs and it worked fine...
What seems to be the problem? I need some help because I have to submit this and the activities that follow also uses data source.
Thanks to those who will help =)

I use Windows Vista SP2, MSVB 2008 Express Edition
 
I didn't add any codes other than those that were auto-generated when I dragged the components.

VB.NET:
Public Class frmPhone

    Private Sub TelbookBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TelbookBindingNavigatorSaveItem.Click
        Me.Validate()
        Me.TelbookBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.TelBookDataSet)
    End Sub

    Private Sub frmPhone_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'TelBookDataSet.Telbook' table. You can move, or remove it, as needed.
        Me.TelbookTableAdapter.Fill(Me.TelBookDataSet.Telbook)
    End Sub
End Class
 
Last edited:
As the comment says, that line in the Load event handler is what loads the data. Fill is a function and it returns the number of rows retrieved. What number does it return?
 
That does seem odd. Zip up your project and attach it to a post so we can have a look at it. Make sure you delete the bin and obj folders first, as you're not allowed to attach executable files.
 
Ok. If it works then I think the problem is on my PC's system...
 

Attachments

  • DataBaseProj.zip
    43.7 KB · Views: 24
Last edited:
Back
Top