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