Código:
Private Sub ddl_ide_col_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl_ide_col.SelectedIndexChanged Dim obj_col As New cls_color Dim obj_data_table As New DataTable With obj_col .ide_col = Val(ddl_ide_col.SelectedItem.Value.ToString) obj_data_table = .buscar_x_ide_col.Tables("usuario") End With If obj_data_table.Rows.Count = 0 Then Label1.Text = "error" Else Label1.Text = "oky" Dim obj_data_row As DataRow For Each obj_data_row In obj_data_table.Rows txt_nom_col.Text = obj_data_row("nom_col") lbl_ide_col.Text = obj_data_row("ide_col") Next End If End Sub
---------
Código:
---------- procedureImports System.Data.SqlClient Public Class cls_color Public ide_col As Integer Public nom_col As String Public Function buscar_x_ide_col() As DataSet Dim obj_conexion As New cls_conexion Dim obj_command As New SqlCommand obj_command.Connection = obj_conexion.obj_SqlConnection obj_command.CommandType = CommandType.StoredProcedure obj_command.CommandText = "usp_color_buscar_x_ide_col" obj_command.Parameters.Add(New SqlParameter("@ide_col", SqlDbType.Int)) obj_command.Parameters("@ide_col").Value = ide_col Dim obj_data_set As New DataSet Dim obj_data_adapter As New SqlDataAdapter(obj_command) obj_conexion.conexion() obj_data_adapter.Fill(obj_data_set, "color") obj_conexion.desconexion() buscar_x_ide_col = obj_data_set End Function End Class
Código:
------------create procedure usp_color_buscar_x_ide_col @ide_col int as select ide_col, nom_col from color where ide_col=@ide_col
alguien podria decirme cual es el error ?? el procedure ni la clase creo que sean el problema, el problema esta en la aplicación :S en que erro, por favor respondan