如何在GridView控件中添加自动编号的功能?

public partial class DataGrid_1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string strConn = System.Configuration.ConfigurationManager.AppSettings["sqlConnectionStringusertest"];
SqlConnection conn = new SqlConnection(strConn);
try
{
conn.Open();
string strda = "select name,nick,pwd,info from guest";
SqlDataAdapter da = new SqlDataAdapter(strda,conn);
DataSet ds = new DataSet();
da.Fill(ds,"testTable");
GridView1.DataSource=ds.Tables[0];
GridView1.DataBind();
}
catch (Exception error)
{
Response.Write(error.Message.ToString());
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//如果当前项不为空
if (e.Row.RowIndex!=-1)
{
//取得当前索引项的值加一
int _ID = Convert.ToInt32(e.Row.RowIndex)+1;
//设置第一列的单元格的内容为当前索引值+1
e.Row.Cells[0].Text = _ID.ToString();
}
}
}