没工作是小,面子是大啊,,,,,,,,,,,,
这么大岁数了还让老板炒,那真是太丢人了,太没脸见人了,,太郁闷了,太抓狂了,所以,请大家快帮我看看这段代码吧,,
生成后也显示出错,选完日期后按确定也不会显示出错,只是WEBGRID依然是没有显示,看来还是没连上数据库,但我的那个存储过程是好使的啊,我在查询器里执行了,没问题啊,请大家帮忙分析分析,,,
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CommonLibrary;
using System.Data.SqlClient;
namespace NetApp.Web.DigitSale
{
/// <summary>
///CustSaleSearch的摘要说明。
/// </summary>
public class CustSaleSearch : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.ImageButton ImageButton2;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected ISNet.WebUI.WebGrid.WebGrid WebGrid1;
private DataSet dataset;
private void Page_Load(object sender, System.EventArgs e)
{
dataset = GetConditionData();
TextBox1.Text=System.DateTime.Today.ToString( "yyyy-MM-dd ");
TextBox2.Text=System.DateTime.Today.ToString( "yyyy-MM-dd ");
// 在此处放置用户代码以初始化页面
}
#region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
this.WebGrid1.InitializeDataSource += new ISNet.WebUI.WebGrid.DataSourceEventHandler(this.WebGrid1_InitializeDataSource);
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private DataSet GetConditionData()
{
return new DataManager().GetCheckCondition();
}
private void WebGrid1_InitializeDataSource(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)
{
}
private void ImageButton1_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{
DataTable td =GetCustSaleS(TextBox1.Text,TextBox2.Text);
WebGrid1.DataSource = td.DefaultView;
WebGrid1.DataBind();
}
private DataTable GetCustSaleS(string Date1,string Date2)
{
return SqlHelper.ExecuteDataset(ConfigInfo.UniqueInstance.ConnectionString,