pass value from gridview to stored procedure
<p>I had stored procedure which get data where Id=@id and the @id which pass to stored from gridview I tried to do that but I couldnot please any one help me</p>

<p></p>

<p>protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {</p>

<pre><code>    using (SqlConnection con = Connection.GetConnection())
    {
        string Sql = "Select Logo From Model where Id=@Id";
        SqlCommand com = new SqlCommand(Sql, con);
        com.Parameters.Add(Parameter.NewInt("@Id", GridView1.SelectedDataKey));
        com.CommandType = CommandType.Text;
        SqlDataReader dr = com.ExecuteReader();
        if (dr.Read())
        {
            string Img2 = dr["Logo"].ToString();
            if (Img2 == System.DBNull.Value.ToString())
            {
                Img.Visible = false;
            }
        }


    }
}
</code></pre>
