Mình có lớp dataservice có string connection=...... thuộc namespace A.setting! giờ Mình có lop frmdangky thuoc namespace B ( Thuoc cung mot chuong trinh )! Giờ mình muốn class frmdangky truy cap den string connection thuoc lop dataserivce trên thì làm như thế nào vậy @@
Announcement
Collapse
No announcement yet.
Truy cap đến 1 đối tượng khác trong c#
Collapse
X
-
Namespce dataQLTDNH.setting
Code:namespace DataQLTDNH.Setting { public class Dataservice : DataTable { public static SqlConnection m_Connection; private SqlDataAdapter m_DataAdapter; private SqlCommand m_Command; public const string strconnection = @"Data source=NHATNGUYEN\SQLEXPRESS;Initial Catalog=QLTDNH;Integrated Security=True";
Code:namespace Quan_ly_Ngan_Hang { public partial class frmDangky: DevComponents.DotNetBar.Metro.MetroForm { const string strconnection = @"Data source=NHATNGUYEN\SQLEXPRESS;Initial Catalog=QLTDNH;Integrated Security=True"; Dataservice m_ds = new Dataservice();
Code:using (SqlConnection conn = new SqlConnection(strconnection))
Comment
-
Code:namespace DataQLTDNH.Setting { public class Dataservice : DataTable { public static SqlConnection m_Connection; private SqlDataAdapter m_DataAdapter; private SqlCommand m_Command; public static const string STRCONNECTION = @"Data source=NHATNGUYEN\SQLEXPRESS;Initial Catalog=QLTDNH;Integrated Security=True";
Code:namespace Quan_ly_Ngan_Hang { public partial class frmDangky: DevComponents.DotNetBar.Metro.MetroForm { Dataservice m_ds = new Dataservice();
Code:using (SqlConnection conn = new SqlConnection(DataQLTDNH.Setting. Dataservice.STRCONNECTION))
Comment
Comment