Select statements of dataset created in the visual designer

Select statements of dataset created in the visual designer

Postby JORGEMAL » Wed 20 Jul 2011 14:24

I created a DataSet using the visual designer, it includes 2 DataTables with their DataAdapters, it also has a relation between the DataTables. The DataAdapters have their select statements which get data from the database, all this was done in the visual designer. I see that, in the visual designer, a property called SelectStatement has the definition for the select statement and what I need is to modify such a property at run time. In my code, I instantiate the DataSet and the DataAdapters and then issue the Fill method to load the information based on the select statement defined in the visual designer. I have looked for the SelectCommand property in order to change its content in code but I do not find it. Is this possible?

Jorge Maldonado
Posts: 164
Joined: Thu 03 Jul 2008 23:55

Postby Shalex » Fri 22 Jul 2011 13:25

As I understood, you are using MS DataSet code generation (added DataSet.xsd template in your project, opened it in MS DataSet Designer, and drag&drop-ed tables on the designer surface from Server Explorer). In this case, please refer to I have managed to resolve this issue in my environment by adding the following property to my DataSet1TableAdapters.myTableAdapter class:
Code: Select all
        public Devart.Data.PostgreSql.PgSqlCommand SelectCommand{
          get {
              return this.CommandCollection[0];

We recommend using Devart DataSet Wizard to create/modify DataSets. Our code generation is based on the advanced capabilities of PgSqlDataTable class.
Devart Team
Posts: 7654
Joined: Thu 14 Aug 2008 12:44

Return to dotConnect for PostgreSQL