 
			
				15/07/2011, 14:38
			
			
			     |  
      |    |    |    Fecha de Ingreso: junio-2011  
						Mensajes: 329
					  Antigüedad: 14 años, 4 meses Puntos: 2     |        |  
  |      Agregar columna a grid por codigo        Tengo un grid el cual lo lleno mediante consultas sql, de esta manera   
Dim DS As DataSet 
        Dim MyConnection As SqlConnection 
        Dim MyCommand As SqlDataAdapter 
MyConnection = New SqlConnection("Data Source=DELL;Initial Catalog=VENTAS;Persist Security Info=True;User ID=sa;Password=3845") 
        MyCommand = New SqlDataAdapter(" select sum(qtysold)as Cantidad from sales2 where reasoncode='01' and idate>='" & TextBox1.Text & "'  AND idate <= '" & TextBox2.Text & "'  and sid= '" & TextBox3.Text & "'", MyConnection)   
DS = New DataSet() 
        MyCommand.Fill(DS, "semusers") 
 GridView1.DataSource = DS.Tables("semusers").DefaultView   
        GridView1.DataBind()   
voy a meter otra consulta a otra tabla...como le puedo hacer para q se me ponga en otra columna..por ejemplo ahorita me pone asi:   
Cantidad   
voy a meter otra consulta sql asi     
select sum(qtysold)as Venta from sales2 where reasoncode='01' and idate>='" & TextBox1.Text & "'  AND idate <= '" & TextBox2.Text & "'  and sid= '" & TextBox3.Text & "'", MyConnection)   
y quierio q quede asi   
Cantidad      Venta   
alguien sabe como..?           |