public DataTable ConnMySql(string strRegisterNo) { try { DataTable dt = new DataTable("table"); string constr = IP"server=.;database=DB;uid=sa; pwd=sa"; string sql = "select * from tablename where ID= ‘" + strNo + "‘"; SqlDataAdapter adptr = new SqlDataAdapter(sql, constr); adptr.Fill(dt); return dt; } catch (Exception ex) { throw ex; } }
原文地址:https://www.cnblogs.com/6B23/p/12211031.html
时间: 2024-12-10 18:52:23