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. Advertisements

  2. jonny

    Brandon Gano Guest

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

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

    Protected Sub MyButton_Click(ByVal sender As Object, ByVal e As EventArgs)

    'TODO: Create data source (MyDataSource)

    MyGrid.DataSource = MyDataSource

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

  3. jonny

    Masudur Guest


    don't forget to visit the asp.net data tutorials...
    every thing you need to work with data is there...

    Masudur, Jul 30, 2007
    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.