Chinaunix首页 | 论坛 | 博客
  • 博客访问: 701382
  • 博文数量: 158
  • 博客积分: 6010
  • 博客等级: 准将
  • 技术积分: 1643
  • 用 户 组: 普通用户
  • 注册时间: 2007-10-11 14:37
个人简介

人法地,地法天,天法道,道法自然

文章分类

全部博文(158)

文章存档

2022年(1)

2020年(3)

2016年(1)

2014年(7)

2013年(4)

2010年(5)

2009年(86)

2008年(25)

2007年(26)

我的朋友

分类:

2009-12-23 23:32:45

TipServies.cs
 
 public string SetResult()
    {
        MySqlCommand mycomm;
        MySqlDataReader dr;
        string strconn = ConfigurationManager.AppSettings["Mysqlsuitem"];
        MySqlConnection myco;
        myco = new MySqlConnection(strconn);
        myco.Open();
        string sql = "select * from bzfn where bzid<20";
        mycomm = new MySqlCommand(sql, myco);
        dr = mycomm.ExecuteReader();
        string xml="\n";
        xml += "\n";
        while (dr.Read())
        {
            xml += CreateXml(System.Convert.ToInt32(dr["bzid"]),dr["级别"].ToString());
           
        }
        xml += "\n";
        dr.Close();
        mycomm.Dispose();
        myco.Close();
        return xml;
    }
    public string CreateXml(int bzid,string jibie)
    {
        string xml = "\n";
        xml += ""+bzid+"\n";
        xml += ""+jibie+"\n";
        xml += "
\n";
        return xml;
    }
 
 
 
MyQuery.aspx
 

    无标题页
   
   


   

   

     
     
     
     
   

       
   



 
XmlData.aspx
 
 protected void Page_Load(object sender, EventArgs e)
    {
       
        Response.ContentType = "text/xml";
        string xml = new TipService().SetResult();
        string mm = xml;
        Response.Write(xml);
        Response.End();
    }
阅读(10819) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~