Tuesday, January 15, 2013

Use Mysql stored procedure in Vb.net

To use mysql stored procedure in vb.net we have to create command object and pass it text as call sp_name


            Dim cmd As New OdbcCommand()
            cmd.Connection = myConnection
            cmd.CommandText = " CALL getcatid(?)"
            cmd.CommandType = CommandType.StoredProcedure

            cmd.Parameters.AddWithValue("@catname1", "Kitchen")
            cmd.Parameters("@catname1").Direction = ParameterDirection.Input

No comments :

Post a Comment