Hi there, I'm havin a session with value of ID. I need to create a query for GridView to show only values linked with user mentioned in session.
So my question is if theres any way how to modify my code which isnt working.

<asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DbConnStr %>" 
        SelectCommand="SELECT [kod_reklamace], [cislo_rekl_zakazky], [kod_vyrobku], [stav], [reklamovane_mnozstvi], [jednotka], [pr], [tp], [tot], [r], [datum_pr_reklamace], [datum_pr_vzor], [no_odeslano_dne], [datum_uz_reklamace] FROM [reklamace] WHERE ([cislo_rekl_zakazky] = @cislo_rekl_zakazky)">
            <asp:SessionParameter Name="cislo_rekl_zakazky" SessionField="jmeno" Type="Int32" />

Im using VB language and mine thoughts were like

identifikace = Session("jmeno")  
SqlDataSource.SelectCommand="Select ...... FROM [reklamace] WHERE ([cislo_rekl_zakazky]="<%identifikace%>")"

The problem is that I dont know how set up whole SqlDataSource by writing a code.

Could any of you help please? Thank you

You can simply fetch rows from the database with SqlDataAdapter object.

Dim Adp as New SqlDataAdapter("select * from tablename where col1='" & Session("id") & "'","put_connection_string")
Dim dt as new DataTable

GridView1.DataSource = dt

Once again sir, thank you.