protected void read_jibenxinxi()
{
MySqlConnection myConn;
myConn = new MySqlConnection(ConfigurationManager.AppSettings["conStrmysql"]);
myConn.Open();
string[] sqlStatements = new string[]
{ "掉电后保持时间","最大时基","最小时基","恒压CH1名称","恒压CH2名称","恒压CH3名称","恒压CH4名称" };
TextBox[] textBoxes = new TextBox[]
{ TextBox1,TextBox2,TextBox3,TextBox5,TextBox6,TextBox7,TextBox8 };
for (int i = 0; i < sqlStatements.Length; i++)
{
string sql = "SELECT " + sqlStatements[i] + " FROM tb_cvte_dips_basic_information WHERE 板卡名称 = '" + DropDownList1.SelectedValue + "'";
MySqlCommand myCmd = new MySqlCommand(sql, myConn);
object result = myCmd.ExecuteScalar();
textBoxes[i].Text = result != null ? result.ToString() : "";
}
myConn.Close();
myConn.Dispose();
}
持续更新中... ... 点个关注和收藏哦
Labview、Python、VBA、C、Excel公式、PCB Layout、PIC单片机、Visual Studio(ASP.NET)、SQL Server ,欢迎沟通讨论
部分文档为做项目过程中的源代码,可能没有注释,有疑问欢迎私信沟通#电子爱好者 #电子专业 #熟悉开关电源原理和测试 #从事硬件自动测试开发