protected void write_jibenxinxi() { using (var myConn = new MySqlConnection(ConfigurationManager.AppSettings["conStrmysql"])) { myConn.Open(); string[] columnNames = new string[] { "板卡名称", "掉电后保持时间", "最大时基", "最小时基","恒压CH1名称", "恒压CH2名称", "恒压CH3名称", "恒压CH4名称","编辑日期", "编辑人" }; string[] values = new string[] { DropDownList1.SelectedValue, TextBox1.Text, TextBox2.Text, TextBox3.Text,TextBox5.Text, TextBox6.Text, TextBox7.Text, TextBox8.Text,DateTime.Now.ToShortDateString(), Session["UserName"].ToString() }; string sqlin = "INSERT INTO tb_cvte_dips_basic_information (" + string.Join(", ", columnNames) + ") VALUES (@" + string.Join(", @", columnNames) + ")"; using (var myCmdin = new MySqlCommand(sqlin, myConn)) { for (int i = 0; i < columnNames.Length; i++) { myCmdin.Parameters.AddWithValue("@" + columnNames[i], values[i]); } myCmdin.ExecuteNonQuery(); } } }
持续更新中... ... 点个关注和收藏哦
Labview、Python、VBA、C、Excel公式、PCB Layout、PIC单片机、Visual Studio(ASP.NET)、SQL Server ,欢迎沟通讨论
部分文档为做项目过程中的源代码,可能没有注释,有疑问欢迎私信沟通#电子爱好者 #电子专业 #熟悉开关电源原理和测试 #从事硬件自动测试开发