private void BindSX() { try { DataSet ds = FYDQuery.GetSX(); this.drpSX.DataSource = ds; this.drpSX.DataBind(); this.drpSX.Items.Insert(0, "请选择"); this.drpSX.SelectedIndex = 0; } catch { this.PrintfError("数据访问错误!"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string type = ""; if (Request["TYPE"] == null) { return; } type = Request["TYPE"]; switch (type) { case "3": DataSet ds3 = null; try { ds3 = FYDQuery.GetFYDY(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds3 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds3.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "4": DataSet ds4 = null; try { ds4 = FYDQuery.GetBMY(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds4 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds4.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "5": DataSet ds5 = null; try { ds5 = FYDQuery.GetCPH(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds5 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds5.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "6": DataSet ds6 = null; try { ds6 = FYDQuery.GetWLH(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds6 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds6.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "7": DataSet ds7 = null; try { ds7 = FYDQuery.GetPH(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds7 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds7.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "8": DataSet ds8 = null; try { ds8 = FYDQuery.GetSX(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds8 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds8.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "10": DataSet ds10 = null; try { ds10 = FYDQuery.Getgg1(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds10 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds10.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "11": DataSet ds11 = null; try { ds11 = FYDQuery.GetTSXX(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds11 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds11.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "12": DataSet ds12 = null; try { ds12 = FYDQuery.GetKHH(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds12 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds12.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "13": DataSet ds13 = null; try { ds13 = FYDQuery.GetADD(); } catch (Exception ex) { string a = ex.Message; Response.Write("ERROR"); } if (ds13 != null) { try { XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Response.ContentEncoding); writer.Formatting = Formatting.Indented; writer.Indentation = 4; writer.IndentChar = ' '; ds13.WriteXml(writer); writer.Flush(); writer.Close(); Response.End(); } catch { } } break; case "14": break; } } }