下面类中的LOAD的作用中什么
namespace WesternByte.MyBlog.Core.Blog
{
/// <summary>
/// BlogDAO 的摘要说明。
/// </summary>
public class BlogDAO:DbObject
{
public string path;
//构造函数
public BlogDAO (){}
public BlogDAO(string webpath){
this.path = webpath;
}
//选取某个Blog信息
public BlogVO Load(int id)
{
Connection.Open();
SqlCommand sqlComm = new SqlCommand("select * from Blog where BlogID = " + id,Connection);
SqlDataReader tmpReader = sqlComm.ExecuteReader();
BlogVO blogVO = new BlogVO();
if(tmpReader.Read()){
blogVO.BlogID = Convert.ToInt32(tmpReader["BlogID"].ToString());
blogVO.Username = tmpReader["Username"].ToString();
blogVO.Password = tmpReader["Password"].ToString();
blogVO.Name = tmpReader["Name"].ToString();
blogVO.Email = tmpReader["Email"].ToString();
blogVO.Subject = tmpReader["Subject"].ToString();
blogVO.Description = tmpReader["Description"].ToString();
blogVO.EntryNum = Convert.ToInt32(tmpReader["EntryNum"].ToString());
blogVO.Role = Convert.ToInt32(tmpReader["Role"].ToString());
blogVO.EssayCount = Convert.ToInt32(tmpReader["EssayCount"].ToString());
blogVO.ArticleCount = Convert.ToInt32(tmpReader["ArticleCount"].ToString());
blogVO.FeedBackCount = Convert.ToInt32(tmpReader["FeedBackCount"].ToString());
}
tmpReader.Close();
Connection.Close();
return blogVO;
}
}
}