ADO.NET数据库有关问题 Comm参数有关问题

ADO.NET数据库问题 Comm参数问题

SqlConnection Conn;
            Conn = new SqlConnection("server=localhost;database=PersonalBlog;uid=sa;pwd='123'");
            Conn.Open();
            string strSQL = "delete from Log where Log_id= @Log_id";
            SqlCommand Comm = new SqlCommand(strSQL, Conn);
            Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =ToInt32(gv.DataKeys[e.RowIndex]);
            Comm.ExecuteNonQuery();
            Conn.Close();
            PageGridView();

我感觉是
 Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =ToInt32(gv.DataKeys[e.RowIndex]);
这有问题。。不太理解这些数据的类型。。错在哪了?
报了  对象必须实现 IConvertible。 错误、、
------最佳解决方案--------------------
这样就没问题了
Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =Convert.ToInt32(gv.DataKeys[e.RowIndex].Value.ToString());
------其他解决方案--------------------
   Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =Convert.ToInt32(gv.DataKeys[e.RowIndex]);
------其他解决方案--------------------
引用:
Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =Convert.ToInt32(gv.DataKeys[e.RowIndex]);

我的代码是Convert.ToInt32,,可能是粘贴错了。。这个是我自己加的,网上找了一个例子是varchar类型的,
我的是int类型的。。我不知道怎么写了。。可能不是这个错。。也可能是其他的错误。、。新手。、
------其他解决方案--------------------
引用:
这样就没问题了
Comm.Parameters.Add("@Log_id", SqlDbType.Int,4).Value =Convert.ToInt32(gv.DataKeys[e.RowIndex].Value.ToString());

膜拜!!!