标签:nta ring pass div 对象 log object datatable ext
private void button1_Click(object sender, EventArgs e) { string conn = "Data Source = 127.0.0.1; Initial Catalog =TPSWOA; User ID = sa; Password = sa"; SqlConnection sqlCon = new SqlConnection(conn); string sql = "select* from 服务对象表"; SqlDataAdapter sd = new SqlDataAdapter(sql , sqlCon); DataTable dt = new DataTable(); sd.Fill(dt); Label[] lab = { label1, label2, label3, label4, label5, label6,label7,label8 ,label9 ,label10 }; Label[] labName = { label11, label12, label13, label14, label15, label16, label17, label18, label19, label20 }; for (int i=0;i<10;i++) { lab[i].Text = dt.Rows[0][i].ToString(); //0 行数,列数为 i; labName[i].Text = dt.Columns[i].ColumnName;//获取列名 } }
标签:nta ring pass div 对象 log object datatable ext
原文地址:https://www.cnblogs.com/any-kiss/p/11623536.html