Thread: chapter 16 ??
View Single Post
  #5 (permalink)  
Old March 15th, 2005, 06:25 PM
farsfar2 farsfar2 is offline
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I did re-write the SQl and it worked with the wizard but when I run it with the hard code, I still get the same error here what I got:

Public Class Form1
    Inherits System.Windows.Forms.Form
    'Declare objects...
    Dim myConnection As OleDbConnection = New OleDbConnection _
    ("provider=Microsoft.jet.oledb.4.0;data source=E:\PUBS1.MDB")
    Dim myAdapter = New OleDbDataAdapter( _
    "SELECT authors.au_id, authors.au_lname, authors.au_fname, " & _
    "titles.title_id, titles.title, titles.price " & _
    " FROM (authors INNER JOIN titleauthor ON authors.au_id = titleauthor.au_id " & _
    "INNER JOIN titles ON titleauthor.title_id = titles.title_id) " & _
    "ORDER BY authors.au_lname, authors.au_fname", myConnection)

    Dim myDS As DataSet
    Dim myDV As DataView
    Dim myCurrencyManager As CurrencyManager
----------------------------------------------------------
this is where the error show:

 Private Sub BindFields()
        'clear any previous bindings...
        txtLastName.DataBindings.Clear()
        txtFirstName.DataBindings.Clear()
        txtBookTitle.DataBindings.Clear()
        txtPrice.DataBindings.Clear()

        'add new bindings to the dataview object..
        txtLastName.DataBindings.Add("Text", myDV, "au_lname")
        txtFirstName.DataBindings.Add("Text", myDV, "au_fname")
        txtBookTitle.DataBindings.Add("Text", myDV, "title")
        txtPrice.DataBindings.Add("Text", myDV, "price")

        'display a ready status
        StatusBar1.Text = "Ready"
    End Sub
any suggestions???? thanks