![]() |
#2
hugeannex2013-10-24 11:22
|
只有本站会员才能查看附件,请 登录
只有本站会员才能查看附件,请 登录

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string userid = e.Row.Cells[1].Text.ToString();
string sql = "select * from tb_user where id = " + userid;
if (co.execSQL(sql))
{
SqlDataReader reader = co.getRow(sql);
reader.Read();
e.Row.Cells[1].Text = reader["name"].ToString();
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
string userid = e.Row.Cells[1].Text.ToString();
string sql = "select * from tb_user where id = " + userid;
if (co.execSQL(sql))
{
SqlDataReader reader = co.getRow(sql);
reader.Read();
e.Row.Cells[1].Text = reader["name"].ToString();
}
}
[ 本帖最后由 a8854827 于 2013-10-24 00:52 编辑 ]