Jump to content

How to refresh unidbgrid data?


Guest

Recommended Posts

Message from: "goodeboy"

 

DataSet.Refresh()

 

or

 

DataSet.close;

DateSet.open;

 

unidbgrid not refresh,why?

 

code list:

 

adoquery1.Connection:=con1;

DataSource1.dataset:=adoquery1;

unidbgrid.DataSource:=DataSource1;

adoquery1.close;

adoquery1.sql.clear;

adoquery1.sql.text:='select * from datalist';

adoquery1.open;

 

 

now add new data code list:

 

con2.Execute('insert into datalist (field1,field2) values(''aa'',''bb'')');

adoquery1.close;

adoquery1.open;

adoquery1.Refresh;

 

but unidbgrid data not refresh

 

why? Thanks!

 

 

 

.

 

Link to comment
Share on other sites

Message from: "Farshad Mohajeri"

 

"goodeboy" wrote in message

news:KeSE1Xv7LHA.3152@anaxagvs227...

> DataSet.Refresh()

>

> or

>

> DataSet.close;

> DateSet.open;

>

> unidbgrid not refresh,why?

>

> code list:

>

> adoquery1.Connection:=con1;

> DataSource1.dataset:=adoquery1;

> unidbgrid.DataSource:=DataSource1;

> adoquery1.close;

> adoquery1.sql.clear;

> adoquery1.sql.text:='select * from datalist';

> adoquery1.open;

>

>

> now add new data code list:

>

> con2.Execute('insert into datalist (field1,field2)

> values(''aa'',''bb'')');

> adoquery1.close;

> adoquery1.open;

> adoquery1.Refresh;

>

> but unidbgrid data not refresh

 

It is not a uniGUI problem. Actually you don't need to call resfresh.

 

This should be enough:

 

adoquery1.open;

adoquery1.Refresh;

 

Are you sure your dataset is refreshed? Also tested in VCL mode?

It seems you use a secondary AdoConnection to insert data.

 

 

.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...