Look at the database and the datatype of the column. The DGV is reflecting that the datatype.
in the database explorer - right click on the table and then click open table definition
check you column data type
probably needs to be - int
" Is there a way to make the data inputed by the user compatible with the data inputed by the program "
Datagridview <------- Cint(UserInputValue)
You know more about the way you have this wired up than i do. So I just showed you how to the conversion.
DataGridView1.Columns(0).ValueType = (
New Integer).GetType
will only allow you to enter integers into Column0 and will also ensure that they are sorted correctly.
To handle incorrect entries handle the DataError event, something like this:
Private Sub DataGridView1_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DataGridView1.DataError
If e.Context = (DataGridViewDataErrorContexts.Parsing Or DataGridViewDataErrorContexts.Commit Or DataGridViewDataErrorContexts.CurrentCellChange) And e.ColumnIndex = 0 Then
"Invalid entry") End If End SubMsgBox(
Or
DataGridView1.Columns(0).ValueType = System.Type.GetType(
"System.Int32")
Be careful when you do that through the "System.Int32" is case sensitive.