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;
}
还未总结完。
/// <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;
}
还未总结完。
相关文章推荐
- Asp.net中GridView使用详解(引)
- Asp.net中GridView使用详解(引)
- Asp.net中GridView使用详解(引)
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解(很全,很经典)
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解(很全,很经典)
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解(很全,很经典)
- Asp.net中GridView使用详解(引)
- 在学习ASP.NET中,GridView 控件的RowDataBound事件的使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- Asp.net中GridView使用详解
- asp.net web中GridView的多种使用方法(详解)