标签:
http://www.oschina.net/code/snippet_557222_34061 只有连接数据库字符串改了下。
public class DAL { private string connstr = "Data Source=localhost;Initial Catalog=code_data;UID=sa;Password=$wuhan888;Persist Security Info=true"; public DataTable selectDB(string sql) { DataTable dt = new DataTable(); try { SqlConnection conn = new SqlConnection(connstr); SqlDataAdapter sda = new SqlDataAdapter(sql, conn); sda.Fill(dt); } catch (Exception e) { } return dt; } }
标签:
原文地址:http://www.cnblogs.com/lilixiang-go/p/4940013.html