版权声明:转载原创文章请以超链接形式请注明原文章出处,尊重作者,尊重原创!
恰饭广告
T_StuInfo表结构:
创建存储过程:
create proc up_getSql as begin select ROW_NUMBER() over(order by StuNO) , StuNO , StuName ,StuSex from T_StuInfo end
主要代码:
string testDB = ConfigurationManager.ConnectionStrings["testDB"].ConnectionString; SqlConnection conn = new SqlConnection(testDB); SqlDataAdapter sda = new SqlDataAdapter("up_getSql", conn); DataSet ds = new DataSet(); sda.Fill(ds); dataGridView1.DataSource = ds.Tables[0]; string[] htext = { "序号","学号", "姓名", "性别" }; for (int i = 0; i < htext.Length; i++) { dataGridView1.Columns[i].HeaderText = htext[i]; }
实现UI
原文链接:https://www.idaobin.com/archives/1055.html
让我恰个饭吧.ヘ( ̄ω ̄ヘ)
恰饭广告