Home>

VisualStudio 2017 Professinal
ASP.NET 4.0

I have a GRIDVIEW = tabular control on the form. We are planning to use SQLDataSource as the data source there.
We are aiming for a specification that places a DropDownList on the same form and narrows down the records to be displayed in the previous GRIDVIEW with this selection.

In other words, I would like to associate the selected value of DropDownList with the WHERE clause in SQLDataSource = SQLCommand adopted for GRIDVIEW.

The screen below is where the SelectCommand of the above SQLDataSource is defined.
The database is Oracle, but is there an error in the placeholder description in the description marked in yellow?
]
That's because .... Even if I press the "Next" button, the screen for associating the selected value of the control with the value specified in the WHERE clause does not appear.
Even if you press the "Next" button, the next screen will be a screen where you simply press the "Finish" button.

In addition, the following is the SQLDataSource of the successful pattern adopted for GRIDVIEW of another form, but after all the following screen appears after the definition of SQLCommand.

Our Visual Studio 2017 is introducing a library called ODT to facilitate connection and development with Oracle, but is this a bug?

In the worst case, what will happen if I modify the asp file that will be originally generated directly and add the Select Parameters part ...

  • Answer # 1

    When using SQL Server, the "Define Parameters" dialog in the second image of the question column appears, but if it does not appear in Oracle, I think that ODT does not support it.

    The same is true for MySQL + Connector/NET + MySQL for Visual Studio, and the "Define Parameters" dialog for the second image does not appear.

    So, I try to write and implement the code myself as shown in the red frame in the image below.

    However, I haven't tried Oracle, so I'm not sure if that will work.

    In the case of Oracle, it becomes a position parameter marker by default (need to set the BindByName property of OracleCommand to use a named parameter?), And the parameter naming convention is:, so I'm worried about that. I will.

    please make sure.

    If it doesn't work, it seems that you can only set the parameters in the handler of the Selecting event of SqlDataSource.