构造函数怎么用get set 方法写
public frmMain(DataTable _dt,string _projectName)
{
dtInfo = _dt;
this.projectName = _projectName;
}
frmMain fm = new frmMain(dt, "综合视频监控系统");
fm.TopMost = true;
fm.Show();
string strSqlCon = "user id = sa ;password = 123456;initial catalog = Vide ; Server = ;";
sqlCon = new SqlConnection(strSqlCon);
sqlCon.Open();
dt = new DataTable();
SqlCommand sqlcmd = sqlCon.CreateCommand();
sqlcmd.CommandText = "select * from Vi_Stream ";
SqlDataReader sqldr = sqlcmd.ExecuteReader();
dt.Load(sqldr);
sqldr.Close();
sqlCon.Close();
怎么用get set 方法写
需要高手
------解决方案--------------------get
{
frmMain fm = new frmMain(dt, "综合视频监控系统");
fm.TopMost = true;
fm.Show();
string strSqlCon = "user id = sa ;password = 123456;initial catalog = Vide ; Server = ;";
sqlCon = new SqlConnection(strSqlCon);
sqlCon.Open();
dt = new DataTable();
SqlCommand sqlcmd = sqlCon.CreateCommand();
sqlcmd.CommandText = "select * from Vi_Stream ";
SqlDataReader sqldr = sqlcmd.ExecuteReader();
dt.Load(sqldr);
sqldr.Close();