Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2005, 17:55
chcma
 
Fecha de Ingreso: junio-2003
Ubicación: Asturias
Mensajes: 2.429
Antigüedad: 20 años, 11 meses
Puntos: 7
SqlParameter, SqlCommand ¿Qué tengo mal? VB.NET

Código:
    Private objCN As SqlConnection
    Private objDA As SqlDataAdapter
    Private objPar As SqlParameter
    Private objCMD As SqlCommand

    Private tbDatos As DataTable
    Private Sub btnDatos_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDatos.Click
        Try
            objCN = New SqlConnection("workstation id=localhost;packet size=4096;user id=sa; password=clave;data source=CARLOS;persist security info=False;initial catalog=bdMSN")

            objCMD = New SqlCommand("PDameContactos", objCN)

            objPar = New SqlParameter("@clienteID", CInt(3))
            objPar.SqlDbType = SqlDbType.Int
            objPar.Direction = ParameterDirection.Input

            objCMD.Parameters.Add(objPar)

            objDA = New SqlDataAdapter(objCMD)

            tbDatos = New DataTable
            objDA.Fill(tbDatos)

            dgDatos.DataSource = tbDatos
            dgDatos.ReadOnly = True
            dgDatos.Refresh()
        Catch ex As SqlException
            MsgBox(ex.Message)

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
La excepción que me sale es la siguiente:

"Sintaxis incorrecta cerca de 'PDameContactos' ". El parametro se llama tal y como está puesto y el Procedimiento almacenado también esta bien puesto.

¿Alguien sabe que puede ser? Gracias
__________________
Charlie.