I would like to add a button that the user can click to execute query - fills gridView control

Discussion in 'ASP .Net' started by jonny, Jul 30, 2007.

  1. jonny

    jonny Guest

    How can I do this with ASP controls & VB.NET

    On click of button run query to fill gridView.
     
    jonny, Jul 30, 2007
    #1
    1. Advertisements

  2. jonny

    Brandon Gano Guest

    I think you want something like this (forgive the sloppy VB; I'm a C# guy):

    --aspx--
    <asp:Button ID="MyButton" runat="server" Text="Fill"
    OnClick="MyButton_Click" />
    <asp:GridView ID="MyGrid" runat="server" ...>
    ...
    </asp:GridView>

    --aspx.vb--
    Protected Sub MyButton_Click(ByVal sender As Object, ByVal e As EventArgs)

    'TODO: Create data source (MyDataSource)

    MyGrid.DataSource = MyDataSource
    MyGrid.DataBind()

    End Sub
     
    Brandon Gano, Jul 30, 2007
    #2
    1. Advertisements

  3. jonny

    Masudur Guest

    Hi...

    don't forget to visit the asp.net data tutorials...
    every thing you need to work with data is there...
    http://www.asp.net/learn/data-access/

    Masudur
     
    Masudur, Jul 30, 2007
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.