当前位置:Gxlcms > ASP > asp textbox获取显示mysql数据示例代码

asp textbox获取显示mysql数据示例代码

时间:2021-07-01 10:21:17 帮助过:44人阅读

代码如下:

using MySql.Data.MySqlClient;

MySqlConnection conn = new MySqlConnection("server=(local);database=abc;uid=;pwd=");
conn.Open();
MySqlCommand com = new MySqlCommand("select * from tb_xxjj",conn);
MySqlDataReader dr = com.ExecuteReader();
dr.Read();
TB_xxjj.Text = dr["title"].ToString();
content.Text = dr["content"].ToString();

人气教程排行