Microsoft Access UPDATE command using C# OleDbConnection and Command NOT working

后端 未结 2 894
孤独总比滥情好
孤独总比滥情好 2020-12-07 03:55

I\'m using Microsoft Access unfortunately because of higher forces and trying to update a record with no luck.

This is the code:

private void UpdateC         


        
相关标签:
2条回答
  • 2020-12-07 04:40

    You need ? for the place holder and the parameters must be added in the order in which they occur: http://msdn.microsoft.com/en-us/library/dw70f090.aspx

    0 讨论(0)
  • 2020-12-07 04:46

    try

    string query = "UPDATE [Contact] SET [FirstName] = ? [LastName] = ?, [MobileNumber] = ? WHERE [Id] = ?"
    

    Add your parameters in the order of the statement, i.e. firstname...id

    0 讨论(0)
提交回复
热议问题