日期:2014-05-17 浏览次数:20484 次
protected void GrvGMMailbox_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)这是父页面的代码 重点在response.write上 运行后报错说sql未定义 (gridview的datakeyname 写的是id 不知与这有没有关系 反正我改成sql也不行) 求指点
{
name = GrvGMMailbox.Rows[e.NewSelectedIndex].Cells[1].Text;
reportID= GrvGMMailbox.Rows[e.NewSelectedIndex].Cells[3].Text;
type= GrvGMMailbox.Rows[e.NewSelectedIndex].Cells[4].Text;
//Label1.Text = department;
//Label2.Text = reportID;
//Label3.Text = type;
ReportInfo();
}
protected void ReportInfo()
{
//判断报告类型来决定需要进行查询的表
if (type == "维修完成报告")
{
string sql = "select * from EP_TblMalfunctionRepairResults where ID='" + reportID + "' and RepairName='" + name + "'";
}
if (type == "复查报告")
{
string sql = "select * from EP_TblMalfunctionCheckResult whereID='" + reportID + "' and InspectorName='" + name + "'";
}
if (type=="故障报告")
{
string sql = "select * from EP_TblMalfunctionReport whereID='" + reportID + "' and ReportName='" + name + "'";
}
Response.Write("<script>window.showModalDialog('ShowReportInfo.aspx?sql=' + sql,'', 'width=481;sheight=300;status=no;resizable=no;screenX=300;screenY=350;top=200;left=300');</script>");
}
protected void Page_Load(object sender, EventArgs e)
{
a =&nb