Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I'm finishing a program which will help to keep records of payments and services a gym, is almost complete, I just have an error that is da.Fill (ds)
Which indicates to me: System.Data.OleDb.OleDbException (0x80040E10): Not specified values for some of the required parameters.

Translated by Google. Original text:

estoy terminando un programa el cual servirá para llevar los registros de pagos y servicios de un gimnasio, esta casi completo, solo me queda un error que es da.Fill(ds)
Donde me indica lo siguiente: System.Data.OleDb.OleDbException (0x80040E10): No se han especificado valores para algunos de los parámetros requeridos.


What I have tried:

Private Sub leepago()
    Dim id As Integer
    Dim s As String
    If DataGridPagos.RowCount > 1 Then
        id = DataGridPagos.Rows(DataGridServicio.CurrentRow.Index).Cells(0).Value.ToString()
    Else
        id = 0
    End If
    s = "SELECT * FROM PAGOS where idregistro = " & id
    con.Close()
    abrirdb()
    Dim da As New OleDbDataAdapter(s, con)
    Dim ds As New DataSet
    da.Fill(ds)
    DataGridPagos.DataSource = ds.Tables(0)
    DataGridPagos.Columns(0).Width = 0
    DataGridPagos.Columns(1).Width = 0
End Sub
Posted
Updated 11-Oct-16 1:24am
v2
Comments
Richard Deeming 10-Oct-16 15:39pm    
This is an English-lanugage site. Please post in English only.

I have translated your question using Google Translate[^].
[no name] 10-Oct-16 18:22pm    
I swear I have seen this before. Use your debugger and find out what your query looks like.

1 solution

C#
id = DataGridPagos.Rows(DataGridServicio.CurrentRow.Index).Cells(0).Value.ToString()


id is an integer try to parse it to an int value and assign it to the sql statement,
Quote:
specified values for some of the required parameters.

basically this error occurs when the values is not specified to the sql statement. i suspect the value is empty from the grid cell. validate the id before use.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900