Sunday, March 25, 2012

GridView

Hi
I need to add in gridview control asp code "delete from t1 whereid=@.id1"
how to declare @.id1 because the server give me mistake
down is the code of asp i use GridView how i can link @.id with field there id?

Thank u and have a nice day
best regards
the code if u need it i use c#

<ASP:SQLDATASOURCE id=SqlDataSource1 <br ConnectionString="<%$ ConnectionStrings:libraryConnectionString %>" runat="server"><BR></ASP:SQLDATASOURCE></ASP:BOUNDFIELD

I don't understand what the <br is doing in the tag, as well as why the data source control is in a bound field; I don't believe BoundField allows text in the tag, as well as child controls.

But you do that through:

<asp:sqldatasource id="s" runat="server" ConnectionString=".." DeleteCommand="yoru query">
<DeleteParameters>
<asp:Parameter Name="@.id" Type="Integer" />
</DeleteParameters>
</asp:sqldatasource>

Something like that.

No comments:

Post a Comment