Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<blockquote> <p><strong>First of all you won't be able to achieve this in design-time by simply adding a select query. You cannot parametrize the schema.</strong></p> </blockquote> <p>However there's a solution for this.Here's how you can do that.</p> <p>1.) Drag and drop the table into your typed-dataset designer which will <strong>create a typed-data-table</strong> for the table and the <strong>table-adapter to access database table</strong>. table adapter is aware of the schema of the data-table.</p> <p>2.) Now <strong>create a stored-procedure</strong> in your database that takes <strong>two arguments</strong>. one is the <strong>schema of the table</strong> [?.ModuleVariable] and other would be your <strong>where clause</strong> or maybe anytihng you may want as criteria. You can create overloads of this as you wish. This stored-procedure will then construct the sql query based on the arguments and execute it on the database. This will <strong>return the result-set to calling table-adapter</strong>.</p> <p>3.) From the design-view <strong>Add a method to table-adapter</strong> which will fetch results from the stored-procedure. <strong>Make sure that the schema of results exactly meets the schema of the associated data-table</strong>.</p> <p>4.) Now from the code you can create an instance of the table adapter and call the method which in turn will call your stored-procedure and <strong>return you with the data-table filled in with results</strong>.</p> <p>Have fun!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload