您的位置:首页 > 编程语言 > ASP

ASP.NET GridView的使用详解

2010-04-09 22:00 288 查看
代码

/// <summary>
/// 根据出版社编号ID查询出版社信息
/// </summary>
/// <param name="publisherId"></param>
/// <returns></returns>

public static Publisher getPublisherByPublisherId(int publisherId)
{
string sql = "select * from publishers where id = @id";
Publisher pub = new Publisher();
SqlParameter[] para = new SqlParameter[]
{
new SqlParameter("@id",publisherId)
};
DataTable table = DBHelper.GetDataSet(sql,para);
foreach (DataRow reader in table.Rows)
{
pub.Id = (int)reader["id"];
pub.Name = (string)reader["name"];
}
return pub;
}

还未总结完。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: