Page 1 of 1

Select statements of dataset created in the visual designer

Posted: Wed 20 Jul 2011 14:24
by JORGEMAL
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?

Respectfully,
Jorge Maldonado

Posted: Fri 22 Jul 2011 13:25
by Shalex
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 http://social.msdn.microsoft.com/forums ... f23d378b1/. 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.