Ver Mensaje Individual
  #7 (permalink)  
Antiguo 16/07/2011, 09:50
mrprogman
 
Fecha de Ingreso: junio-2011
Mensajes: 329
Antigüedad: 12 años, 10 meses
Puntos: 2
textbox & sqldatasource

si quiesiera hacer este mismo procedimiento con una consulta sql..como quedaria este es mi codigo..

sqlconn = New SqlConnection("Data Source=DELL;Initial Catalog=VENTAS;Persist Security Info=True;User ID=sa;Password=3845")
sqlconn.Open()
cmd.CommandText = " select sum(qtysold) as Cantidad from sales2 where reasoncode='01' and sid= '" & TextBox3.Text & "' and idate>= ' " & TextBox1.Text & " ' and idate<= ' " & TextBox2.Text & " ' "

cmd.Connection = sqlconn
TextBox4.Text = cmd.ExecuteScalar().ToString()
TextBox35.Text = TextBox7.Text / TextBox31.Text * -1 * 100
el problema es q si contiene valores nulos me marca error a la hora de hacer la operacion...