我有這個DataGridView和一個BindingNavigator .. 每當我添加一個新條目時,它會返回一個錯誤: 'Column'newsID'不允許爲空。VB.NET 2008中的BindingNavigator
但在我的MySQL數據庫中,newsID列設置爲AutoIncrement。 我將如何解決這個問題?
謝謝!
這裏是我的代碼:
Public Class FormNews
Private Sub FormNews_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'TODO: This line of code loads data into the 'UCWebDataSet.news' table. You can move, or remove it, as needed.
Me.NewsTableAdapter.Fill(Me.UCWebDataSet.news)
End Sub
Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click
Me.Validate()
Me.NewsBindingSource.EndEdit()
Me.NewsTableAdapter.Update(Me.UCWebDataSet)
End Sub
End Class
顯示您正在使用的語句,也許我們可以提供幫助。 – Younes 2010-01-18 08:14:28