none
multiple parameter query dataset RRS feed

  • Question

  • The dataset with the argument cboSpeed works fine,

    Me.CUS_ASSET_TER_NAMETableAdapter.Fill(Me.DataSet1.CUS_ASSET_TER_NAME, cboSpeed.SelectedItem.ToString())

    However, if I add another argument which is a control name on the form, i got the following error:

    Error    1    Too many arguments to 'Public Overridable Overloads Function Fill(dataTable As DataSet1.CUS_ASSET_TER_NAMEDataTable, Val As Decimal) As Integer'.    D:\Documents and Settings\fnoble\My Documents\Visual Studio 2008\Projects\OverSpeed\OverSpeed\Form1.vb    15    114    OverSpeed
     
    Is there a way to put more arguments so that i can have controls on the form that should sets the filter on the dataset result?

    For more info, I am working on an Oracle database and am trying to build a report. My filter requirements are "setting vehicle speed", and "Between dates".
    Monday, January 25, 2010 2:27 PM

Answers

  • Hi Michael,

    Thanks for the info above. However, in the "TableAdapter Query Configuration Wizard" screen, the first button (Select SQL statement) is selected but the other buttons (... stored procedure) selections are grayed out (cannot be selected). How can i make those buttons (... stored procedure) available for selection??? Is there something i missed to make the wizard not giving me a selection???

    Francis
    • Marked as answer by Francisconoble Thursday, January 28, 2010 8:52 AM
    • Unmarked as answer by Francisconoble Thursday, January 28, 2010 8:52 AM
    • Marked as answer by Francisconoble Thursday, January 28, 2010 8:54 AM
    Tuesday, January 26, 2010 2:00 PM

All replies

  • Go to the dataset designer, select the tableadapter (CUS_ASSET_TER_NAMETableAdapter in your case), rightclick and select Add Query.
    Then select either "Create new stored procedure" or "Use existing procedure".
    Then complete the rest of the dialogs appropriately depending on if you created a new or used an existing one.

    You should now have a query that matches and takes the number of parameters that matches your requirement.
    Then use that Fill method to populate your datatable.

    "How to: Create Parameterized TableAdapter Queries"
    http://msdn.microsoft.com/en-us/library/ms171905.aspx
    "TableAdapter Overview"
    http://msdn.microsoft.com/en-us/library/bz9tthwx.aspx

    HTH
    //Michael

    This posting is provided "AS IS" with no warranties.
    Tuesday, January 26, 2010 8:29 AM
  • Hi Michael,

    Thanks for the info above. However, in the "TableAdapter Query Configuration Wizard" screen, the first button (Select SQL statement) is selected but the other buttons (... stored procedure) selections are grayed out (cannot be selected). How can i make those buttons (... stored procedure) available for selection??? Is there something i missed to make the wizard not giving me a selection???

    Francis
    • Marked as answer by Francisconoble Thursday, January 28, 2010 8:52 AM
    • Unmarked as answer by Francisconoble Thursday, January 28, 2010 8:52 AM
    • Marked as answer by Francisconoble Thursday, January 28, 2010 8:54 AM
    Tuesday, January 26, 2010 2:00 PM