刷新Datagrid [英] Refreshing a Datagrid

查看:53
本文介绍了刷新Datagrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个免费网站,主持人或任何人都不必回答,如果他们不想...但如果有人知道如何回答这个问题,请帮助这个。


i已经多次改变我的项目以尝试获得我想要的结果,但似乎无法让这一件事工作数据网格和数据列表工作正常。我已经在网上查看我是否可以采用另一种方式。读了这么多书,但是没有其他方式我发现我已经搜索过这个网站,但除了我留下的帖子之外什么都没有,当然我也找不到那里的答案。因为它只发布了相同的问题。所以我想我会再次回答我的问题。


我已经制定了一个程序,所以当我支付账单时,我可以点击数据列表中的账单名称。并且只有这个名称的账单才会显示在数据网格中。


我设置的方式是,我在表单上有两个ADODC控件。
第一个ADODC控件用于DATALIST,第二个ADODC控件用于DATAGRID。


和一个数据网格。 datagrid ADODC2连接到我用Visual Data Manager进行的数据库。称为BillDetails连接字符串连接到BillDetails和BillDetails。并且记录源是表格DetailsT。在数据库中我有这些字段

I know this is a free site and the moderators or anybody don''t have to answer if they don''t want to.. but if there is someone who knows how to answer this question please help with this one.

i have changed my project so many times to try to get the results i want but can''t seem to get this one thing to work the datagrid and datalist to work right. i have looked on the web to see if i could do it another way. and read so many books but there isn''t another way i have found i have searched this site but nothing but the posts i have left and certainly i won''t find the answers there. Because it only has the same question posted. so i guess i will go through my question again.

I have made a program so when i pay a bill i can click on the name of the bill in the datalist. and only them bills for that name will show in the datagrid.

the way i have this set up is, i have TWO ADODC controls on the form. and one datagrid and one datalist.

the first ADODC control is for the DATALIST and the second ADODC control is for the DATAGRID.

the datagrid ADODC2 is connected to a database i have made with the "Visual Data Manager" called "BillDetails" the connectionstring is connected to "BillDetails" and the recordsource is to the table "DetailsT" which in the database i have these fields


BillID

AmountDue

AmountPaid
DueDate

DatePaid

ReferenceNumber

BillBalance
BillID
AmountDue
AmountPaid
DueDate
DatePaid
ReferenceNumber
BillBalance



" BILLID"我创建了一个文本字段,因为我想添加自己的ID。我不知道你是否可以这样做但是我有。


数据主义者ADODC1连接到我用Visual Data Manager制作的数据库。称为BillInformation连接字符串连接到BillInformation。并且记录源是SELECT * FROM DetailsT; ROWSOURCE是ADODC1。 LISTFIELD被设置为BILLNAME DATASOURCE是对ADODC1的DATAFIELD是BILLNAME BOUNDCOLUMN对于BILLID是指BILLID。在数据库中我有这些字段

The "BillID" I have made a text field because i want to add my own ID''s. I don''t know if you can do this but i have.

the datalist ADODC1 is connected to a database i have made with the "Visual Data Manager" called "BillInformation" the connectionstring is connected to "BillInformation" and the recordsource is "SELECT * FROM DetailsT" the "ROWSOURCE" is to the ADODC1. the "LISTFIELD" is set to the "BILLNAME" the "DATASOURCE" is to ADODC1 the "DATAFIELD" is to "BILLNAME" the "BOUNDCOLUMN" is to the "BILLID" which in the database i have these fields


BillID

BillName

地址

City

State

ZipCode

PhoneNumber
BillID
BillName
Address
City
State
ZipCode
PhoneNumber



DATALIST点击事件的代码是:

The code for the DATALIST click event is this:

展开 | 选择 | Wrap | 行号

推荐答案




您的查询中有一个额外的单引号..


如果BillID是Numeric,则在Table中,然后给出如下的Query语句:


strQuery =" Select * FROM DetailsT WHERE BillID =" &安培; _

Val(DataList1.BoundText)


如果是Text,那么:


strQuery ="选择* FROM DetailsT WHERE BillID =''" &安培; _

DataList1.BoundText& "''"


问候

Veena
Hi,

You have one extra single quote in your query..

In the Table if BillID is Numeric, then give your Query statement like this :

strQuery = "Select * FROM DetailsT WHERE BillID = " & _
Val(DataList1.BoundText)

If it is Text then :

strQuery = "Select * FROM DetailsT WHERE BillID = ''" & _
DataList1.BoundText & "''"


Regards
Veena


我试过两种方法它仍然指向REFRESH它给我的错误是(FROM子句中的语法错误)


lee123
Well I have Tried Both Ways And It Still Points To The "REFRESH" the error it gives me is (Syntax error in FROM clause)

lee123


感谢我花了一段时间来解决这个问题我得到它的工作,我点击我的列表中的名称后,我有另一个问题,数据网格更改为该帐单,在详细信息数据库中有货币值如何在我点击后在数据网格中以货币显示它们在名字上。因为现在当表单打开时,每个账单都显示出来,我已经通过数据网格中的属性设置了货币值,而且它是货币。


但是当我点击一个名字时它会去恢复正常。我该如何改变


lee123
thanks for the response it took me awhile to figure it out but i got it working i have another question for you after i have click on a name in my list and the datagrid changes to that bill there are currency values in the the details database how do i show them in currency in the datagrid after i have click on a name. because right now when the form opens every bill is showing and i have set the currency value through the properties in the datagrid and it is currency.

but when i click on a name it goes back to normal. how do i change that

lee123


这篇关于刷新Datagrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆