时间:2021-07-01 10:21:17 帮助过:2人阅读
2.引用
1 using System.Data; 2 using System.Data.SqlClient; 3 using System.Data.OleDb;
3.代码
1 private DataSet GetData() 2 { 3 OleDbConnection conn = new OleDbConnection(System.Configuration.ConfigurationManager.AppSettings["OleDbConnString"]); 4 conn.Open(); 5 string osqlstr ="select a.id,a.uname,a.utype,b.id did,b.fid,b.shorder from g_users A,G_DEPT B where a.status>-1 and a.id=b.user_id "; 6 7 OleDbDataAdapter oda = new OleDbDataAdapter(osqlstr, conn); 8 9 DataSet ods = new DataSet(); 10 oda.Fill(ods); 11 12 return ods; 13 }
数据库连接
标签: