Mi codifo es el siguiente:
Código C++:
Ver original
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; public partial class Default2 : System.Web.UI.Page { SqlConnection cnn = new SqlConnection("SERVER=Valp-Maple01;UID=sa;PWD=messrv;DataBase=wasp"); protected void Button1_Click(object sender, EventArgs e) { //SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM PESOS WHERE FECHA >='" + DropDownList1.Text.Trim() + DropDownList2.Text.Trim() + DropDownList3.Text.Trim() + "'and hora='7:00 - 7:30'",cnn); SqlDataAdapter da = new SqlDataAdapter("SELECT p.peso,p.fecha,o.linea,o.tubo,o.codigo from pesos as p, optimas as o where fecha >='20101029' and empaque=1 and codOptima=codigo", cnn); DataSet ds = new DataSet(); da.Fill(ds); GridView1.DataSource = ds.Tables[0]; DataBind(); //Label1.Text = DropDownList1.Text.Trim() + DropDownList2.Text.Trim() + DropDownList3.Text.Trim(); } protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e) { GridView1.PageIndex = e.NewPageIndex; GridView1.DataBind(); } protected void Page_Load(object sender, EventArgs e) { //Response.Buffer = false; } }