asp textbox获取显示mysql数据示例代码
(编辑:jimmy 日期: 2024/11/27 浏览:3 次 )
复制代码 代码如下:
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();
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();
下一篇:asp页面提高的访问速度的方法详解