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; } }