Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/09/2012, 10:17
3ricks0ul
 
Fecha de Ingreso: junio-2012
Mensajes: 90
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: Duda VB 2010 .NET + SQL 2008

Bueno...me arte xD y lo hize con una query "embebida"....pero aun quiero saber como hacerlo con un stored procedure para que mi codigo se vea mejor :( aqui esta el codigo con el que me funciono


pero esta feo -.-


Dim i As Integer = Convert.ToInt32(cmbEmp.SelectedValue)

Dim cmd As New SqlCommand("SELECT sorting.sort_num,sorting.date,sorting.time,sorting .year,sorting.month FROM employments,sorting WHERE sorting.id_person = @id AND employments.name +' '+ employments.lastname = @cname", cnn)
Dim dt As New DataTable
Dim da As New SqlDataAdapter(cmd)
cmd.Parameters.AddWithValue("@id", i)
cmd.Parameters.AddWithValue("@cname", cmbEmp.Text.ToString())
Dim ds As New DataSet
da.Fill(ds)
gridview1.DataSource = ds.Tables(0)