看了些逻辑三层的例子,
public class User
{
private int m_UserID;
private string m_UserName;
private string m_PassWord;
public int UserID {
get {return this.m_UserID;}
set {this.m_UserID = value;}
}
public string UserName
{
get {return this.m_UserName;}
set {this.m_UserName = value;}
}
public string PassWord
{
get {return this.m_PassWord;}
set {this.m_PassWord = value;}
}
public User(){}
public User(int userid,string username,string password)
{
this.m_UserID = userid;
this.m_UserName = username;
this.m_PassWord = password;
}
}
这样的类实例化成个类的集合绑定到DataGrid上,但没看到怎么做到把DataGrid的变动 更新到DB的做法.大家能贴个例程吗。 要做到这样,是不是只能传递DataSet?
public class User
{
private int m_UserID;
private string m_UserName;
private string m_PassWord;
public int UserID {
get {return this.m_UserID;}
set {this.m_UserID = value;}
}
public string UserName
{
get {return this.m_UserName;}
set {this.m_UserName = value;}
}
public string PassWord
{
get {return this.m_PassWord;}
set {this.m_PassWord = value;}
}
public User(){}
public User(int userid,string username,string password)
{
this.m_UserID = userid;
this.m_UserName = username;
this.m_PassWord = password;
}
}
这样的类实例化成个类的集合绑定到DataGrid上,但没看到怎么做到把DataGrid的变动 更新到DB的做法.大家能贴个例程吗。 要做到这样,是不是只能传递DataSet?
再更新类或类集合实例
应该不能用遍历的方式,这样的话,数据库的连接不是经常Open和Close.
菜鸟问的问题,盼大家耐心指点一下。