Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 12 total
Thread Cannot see data in grid
Wed, Oct 5 2016 9:35 PMPermanent Link

TD

Advanced Data Systems, Inc.

What am I missing here?

In Database Manager I created a database named db_main.  Clicking on the Test button of db_main shows successful.

Next in Database Manager I created a dataset named equip_type and set it to db_main. In the Preview tab of equip_type I see the data.

I created a form and placed a TDataset component on it named ds_equip_type and set it to equip_type in Database Manager.

Next I added a TGrid component to the form and set it to the ds_equip_type.

When the form shows in the web browser no data appears in the grid.

Thanks,
TD
Wed, Oct 5 2016 9:50 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/5/2016 9:35 PM, TD wrote:
> What am I missing here?
> I created a form and placed a TDataset component on it named ds_equip_type and set it to equip_type in Database Manager.

I suspect it's this - did you actually add any columns to the dataset ?

Easiest is to simply drag from dataset manager and EWB designer creates
the proper TDataset automagically.


> Next I added a TGrid component to the form and set it to the ds_equip_type.

Did grid auto populate with columns ? if not the dataset does not have them.

Raul
Thu, Oct 6 2016 11:18 AMPermanent Link

Trinione

<< I created a form and placed a TDataset component on it named ds_equip_type and set it to equip_type in Database Manager.

Next I added a TGrid component to the form and set it to the ds_equip_type. >>

TD,
Ordering is important. (1) Add the Grid onto the form, then (2) Drop the DataSet onto the Form for it to auto-populates. If not, you need to manually add the columns for them to appear.
Thu, Oct 6 2016 12:03 PMPermanent Link

TD

Advanced Data Systems, Inc.

Thanks Raul and Trinione for trying to help.  I already had the column added to the grid.  As an experiment I created a new form and did as you suggested Trinione and added the TGrid first then dropped the TDataset from the Database Manager onto this new form; still nothing.

What other information can I provide to you guys to help diagnose the problem?

Thanks,
TD
Thu, Oct 6 2016 3:00 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/6/2016 12:03 PM, TD wrote:
> Thanks Raul and Trinione for trying to help.  I already had the column added to the grid.  As an experiment I created a new form and did as you suggested Trinione and added the TGrid first then dropped the TDataset from the Database Manager onto this new form; still nothing.
> What other information can I provide to you guys to help diagnose the problem?

Looking at this today with fresh eyes i realized you're actually not
specifying database and not loading any data into dataset.

Linking dataset to grid is just that - link - this itself does not
result in any data being loaded into dataset.

So you'd need to do something like this in an appropriate place in your
code.

Example below uses form oncreate so it loads when form is created

procedure TMyMain.Form1Create(Sender: TObject);
begin
   Database.DatabaseName:='db_main'; //specify Database to use
   Database.Loadrows(equip_type);    //load your dataset(s)
end;

Raul

Thu, Oct 6 2016 3:04 PMPermanent Link

Raul

Team Elevate Team Elevate

On 10/6/2016 11:18 AM, Trinione wrote:
> Ordering is important. (1) Add the Grid onto the form, then (2) Drop the DataSet onto the Form for it to auto-populates. If not, you need to manually add the columns for them to appear.

That's not my experience - you can drop them in any order.

As long as i drag dataset from database manager i always get columns.

in terms of grid auto-population of grid works if you don't have any
columns already.

So it works 1st time you link the dataset to grid or if you clear the
grid dataset name, manually delete all columns and then specify the
dataset again - it will repopulate columns into grid again

Raul
Thu, Oct 6 2016 10:10 PMPermanent Link

TD

Advanced Data Systems, Inc.

Raul wrote:
So you'd need to do something like this in an appropriate place in your
code.

Example below uses form oncreate so it loads when form is created

procedure TMyMain.Form1Create(Sender: TObject);
begin
   Database.DatabaseName:='db_main'; //specify Database to use
   Database.Loadrows(equip_type);    //load your dataset(s)
end;

Raul


I added these lines of code and now I get this error:
Dataset load response error (Resource / databases not found)
Line 20644

I have checked everything I know to check and all looks correct; any ideas?

Thanks,
TD
Fri, Oct 7 2016 7:18 AMPermanent Link

Raul

Team Elevate Team Elevate

On 10/6/2016 10:10 PM, TD wrote:
> I added these lines of code and now I get this error:
> Dataset load response error (Resource / databases not found)
> Line 20644
>
> I have checked everything I know to check and all looks correct; any ideas?

TD,

This now looks like like EWB web server config issue.

In EWB IDE if you go to Environment->Options  and switch to internal web
server tab.

What does the "database resource name" say ?

It should be "databases" (without quotes)

EWB 2.0.5 should have changed this when upgrading from earlier version
(it used to be "datasets") but if not then just change it manually. You
need to stop/start internal web server for change to take effect.

Raul
Fri, Oct 7 2016 7:30 AMPermanent Link

Trinione

Have you Imported the DataSets into the EWB Server?
Fri, Oct 7 2016 9:38 AMPermanent Link

TD

Advanced Data Systems, Inc.

This now looks like like EWB web server config issue.

In EWB IDE if you go to Environment->Options  and switch to internal web
server tab.

What does the "database resource name" say ?

It should be "databases" (without quotes)

EWB 2.0.5 should have changed this when upgrading from earlier version
(it used to be "datasets") but if not then just change it manually. You
need to stop/start internal web server for change to take effect.

Raul

BINGO !  Changed it to 'databases' and it now works!

Thanks Raul
Page 1 of 2Next Page »
Jump to Page:  1 2
Image