• Sean Lange (1/28/2013)


    pwalter83 (1/28/2013)


    Sean Lange (1/28/2013)


    OK easy enough. As I said previously you will need to use an event of the button. Since you want this to happen when the user clicks the button, you will use the click event.

    Just add code to your click event to run your query. Stick the results of your query into a datatable and bind your gridview to the datatable.

    Thanks Sean,

    Do I need to add the code to the 'OnClientClick' property ? This is the only property I can see on the list.

    Also, I cannot find the component 'datatable', is it the same as 'Table' ?

    lastly, do you refer to gridview as the component or as a property ?

    Sorry for the botheration.

    Thanks.

    I am going to guess you don't know much about web development. The OnClientClick event is the client side event for clicking. You want the server side event (unless you are going to do this via jquery).

    DataTable belongs to the System.Data namespace. I don't know how you are querying your data. If you are using a SqlDataSource you will have to add parameters to the select property and requery server side.

    The GridView is what you will use to display the results of your query.

    I would highly recommend you dig around and find some tutorials on basic asp.net development. Not trying to sound rude but you really need to understand what you are doing and from your posts it seems you are very unfamiliar with how this stuff works. Web development is quite different than windows applications because you have code that runs on the server and code that runs on the client and you have to deal with both.

    Thanks Sean,

    I have come to a point where I need to add the sql code within this:

    ---------------------------------------

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    End Sub

    ---------------------------------------

    The SQL code would be as you suggested- "select Columns from MyTable where Col1 = Combobox 1 and Col2 = Combobox 2" but I dont know what vb.net syntax I need to enter this in.

    Any suggestions would be welcome. Thanks,

    Paul