Wednesday, 23 November 2011

Sql Adapter Parameter

Giving parameter to SQL Adapter:



as you use for-
SqlDataAdapter cmd = new SqlDataAdapter(rer, con);
        cmd.Parameters.Add("@hh", SqlDbType.VarChar).Value = ((Label)GridView1.Rows[e.RowIndex].FindControl("HAID")).Text;


just use-
SqlDataAdapter cmd = new SqlDataAdapter(rer, con);
        cmd.SelectCommand.Parameters.Add("@hh", SqlDbType.VarChar).Value = ((Label)GridView1.Rows[e.RowIndex].FindControl("HAID")).Text;



No comments:

Post a Comment

Print Only Grid View in ASP.net

ASP.net How to Print Only GridView < div id ="gridviewDiv" >   < asp:GridView ID ="gridViewToPri...