1.后台方法 public string id; public string usercode; public void tbalelist(string strsql) { string str = string.Empty; DBCon OAcon = new DBCon(); SqlConnection myConn = new SqlConnection(OAcon.getOAcon()); myConn.Open(); SqlCommand sc = new SqlCommand(strsql, myConn); SqlDataReader sr = sc.ExecuteReader(); if(sr.Read()) { id=sr[0].ToString(); usercode = sr[1].ToString(); } sr.Close(); myConn.Close(); } 2.前台 ID 张号 <%= id %> <%= usercode %>
[Asp.Net]实现提取数据到table中 不用服务器控件
关注
打赏