Récupérer une donnée d'un SDS à partir d'un GridView
Bonjour à tous
J'ai placé un SqlDataSource et un GridView dans ma page de manière assez simple :
Code:
1 2 3
|
<asp:SqlDataSource ID="sdsContact" runat="server" ConnectionString="<%$ ConnectionStrings:DataDev %>"></asp:SqlDataSource>
<asp:GridView ID="gvContact" runat="server" DataKeyNames="IdImmoContact" DataSourceID="sdsContact"></asp:GridView> |
Je les ai chargé par le CodeBehind comme suit :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
With sdsContact
.SelectCommandType = SqlDataSourceCommandType.Text
.SelectCommand = "EXEC dbo.IMMO_ContactVendeurListe '31AA4C17-C261-436D-8F29-8A6E8005CF5C'"
.DeleteCommandType = SqlDataSourceCommandType.Text
.DeleteCommand = "DELETE FROM dbo.IMMO_Contact WHERE IdImmoContact = @IdImmoContact"
End With
Dim bfNomContact, bfTelContact, bfMailContact As New BoundField
Dim btfVoirContact As New ButtonField
With gvContact
.AutoGenerateDeleteButton = True
.AutoGenerateColumns = False
With .Columns
.Add(bfNomContact)
.Add(bfTelContact)
.Add(bfMailContact)
.Add(btfVoirContact)
End With
.DataBind()
End With |
Donc rien de bien transcendental jusque là.
Maintenant, je voudrais récupérer (dans mon évènement RowCommand du GridView) une donnée qui se trouve dans mon SDS et que je n'affiche pas dans mon GridView et je ne sais pas comment faire. Je ne trouve pas de doc ou de tuto qui m'explique ça.
Pourriez vous me donner le point de départ ?