Ver Mensaje Individual
  #1  
Antiguo 22-03-2013
teecweb teecweb is offline
Miembro
NULL
 
Registrado: feb 2013
Posts: 64
Reputación: 14
teecweb Va por buen camino
pasar paaremtro mysql con visual 2008

Holas me sale error Incorrect number of arguments for PROCEDURE cscallcentermysql.sp_InsertInto_tblUser; expected 16, got 0 ..al correr el codigo..agradecere por ssu respuestas
Código SQL [-]

Imports System.Data
Imports System.Data.SqlClient
Imports MySql.Data.MySqlClient
Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim conn As New MySqlConnection()
        Dim cmd As MySqlCommand
        ' conStr = "server=localhost;username=root;password= ;database=cscallcentermysql"
        'conStr = "server=localhost;user id=root;password= ;database=cscallcentermysql; Integrated Security=True"
        'Dim con As New SqlClient.SqlConnection(conStr)

        Dim cConnString As String
        cConnString = _
        "Server=localhost;Database=cscallcentermysql;User ID=root;Password= "
        '-- crea un objeto de coneccion y espefica el conn string 

        Dim oConn As New MySqlConnection
        oConn.ConnectionString = cConnString
        '-- abre y cierra la conexion
        ' oConn.Open()



        Try

            oConn.Open()
            MsgBox("conecto exitosamente  ")
        Catch ex As Exception
            MsgBox("no conecto ")
            MsgBox("Error: " + ex.Message, MsgBoxStyle.Critical + MsgBoxStyle.Exclamation, "Execute Store Procedure")
            'Código de captura de la excepción
        End Try

        cmd = New MySqlCommand()
        cmd.Connection = oConn

        cmd.CommandText = "sp_InsertInto_tblUser"
        cmd.Parameters.AddWithValue("@xtxtLastName", "elizabeth")
        cmd.Parameters.AddWithValue("@xtxtFirstName", "ramos")
        cmd.Parameters.AddWithValue("@xtxtInitials", "RA")
        cmd.Parameters.AddWithValue("@xtxtHomePhone", "")
        cmd.Parameters.AddWithValue("@xtxtMobilePhone", "")
        cmd.Parameters.AddWithValue("@xtxtAddress", "")
        cmd.Parameters.AddWithValue("@xtxtCountry", "")
        cmd.Parameters.AddWithValue("@xtxtState", "")
        cmd.Parameters.AddWithValue("@xtxtCity", "")
        cmd.Parameters.AddWithValue("@xtxtTimeZone", "")
        cmd.Parameters.AddWithValue("@xtxtIdentification", "")
        cmd.Parameters.AddWithValue("@xtxtIdentificationType", "")
        cmd.Parameters.AddWithValue("@xtxtSign", "")
        cmd.Parameters.AddWithValue("@xintReviewEmails", 0)
        cmd.Parameters.AddWithValue("@xdatStartDate", "")
        cmd.Parameters.AddWithValue("@xintDailyNumberofCalls", 0)
        cmd.ExecuteNonQuery()




       
    End Sub
End Class