Results 1 to 21 of 21

Thread: [RESOLVED] Syntax Error in UPDATE statement

Threaded View

  1. #1

    Thread Starter
    Lively Member RichardKnox's Avatar
    Join Date
    Jul 2009
    Location
    Southern Michigan
    Posts
    89

    Resolved [RESOLVED] Syntax Error in UPDATE statement

    HI, I am unable to figure out why I am getting this error. Its probably simple, but I haven't found out how to fix it yet.


    Here's the piece of code thats giving me the error.



    Code:
    Public Class DrugList
    Private m_cnADONetConnection As New OleDb.OleDbConnection() 
    Private m_daDataAdapter as OleDb.OleDbDataAdapter
    Private m_cbCommandBuilder as OleDb.OleDbCommandBuilder
    Private m_dtDrugs as New DataTable
    Private m_rowPosition as Integer = 0
    
    ----------------------------------------------------------------------------------------------------------
    Private Sub btnSave ()
    
    If m_dtDrugs.Rows.Count <> 0 then
    m_dtDrugs.Rows(m_rowPosition) ("YesNo") = txtYorN.Text
    m_daDataAdapter.Update(m_dtDrugs)  <----------------------This is the line that throws the error.
    End if
    End Sub
    End Class
    I am able to access the database, work my way through the data, add data, but when I attempt to update the data, I get the error.

    So, I know I am accessing the database, but Im not sure why it keeps giving me the error in the Subject line.

    Any help would be greatfully received.

    Thanks,
    Richard
    Last edited by RichardKnox; Jul 19th, 2009 at 09:19 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width