将布尔参数发送到TableAdapter的问题 [英] problem of sending boolean parameter to TableAdapter

查看:77
本文介绍了将布尔参数发送到TableAdapter的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我在应用程序和TableAdapter中创建了一个数据集.此TableAdapter从数据库的两个表中获取数据,并内部绑定它们.其中一个字段名为Active.TableAdapter只是从其活动字段= 0的dataBase中获取数据.然后我创建了一个表单,并在其中放置了一个DevExpressDataGrid并将TAbleAdapter绑定到该表单.
我在将devepressDataGrid的已编辑列的新值发送到TableAdapter时遇到问题.此数据网格有4个coulmn,其中之一被命名为delete列,其中显示了Active字段.此列定义为bit,我可以检查该列的某些行.
我想当我检查某些行的​​删除行,然后按删除按钮时,该行将被删除.
现在我不知道如何将布尔参数发送到tableAdapter.当行的删除列被选中,编辑该行= 1,并为下一次活动费尔德不告诉他们.
我知道我应该为tableAdapter创建一个updateQuery并向其发送(Active)的新值,但是如何呢?我尝试了不同的代码,但没有用.
我使用的代码之一:




i created a dataset in the application and a TableAdapter.this TableAdapter gets data from two tables of the dataBase and inner jioned them. one of the fields is named Active.TableAdapter just gets the data from the dataBase which their active fields =0.then i created a form and put a DevExpressDataGrid in it and bound the the TAbleAdapter to it.
i have a problem to sending the new value of a edited column of the devepressDataGrid to the TableAdapter.this datagrid has 4 coulmn which one of them is named as delete column ,which showes Active field. this column is defined as bit , that i can check some rows of that column.
i want when i check the delete coulmn of some rows , and then press the delete button ,that rows be deleted .
now i dont know how to send the boolean parameter to the tableAdapter. that when the delete column of the row is checked, Edit the Active feild of that row =1 and for the next time dont show them.
i know i should create an updateQuery for the tableAdapter an send the new value of ( Active )to it, but how? i tryed different codes but they didnt work.
one of the code i used:



Dim g As Boolean
Dim chkStatus As DevExpress.XtraEditors.CheckEdit = DirectCast(sender, DevExpress.XtraEditors.CheckEdit)
*Dim row As DataGridViewRow = DirectCast(chkStatus.NamingContainer, DataGridViewRow)

If chkStatus.Checked Then
    g = True
Else
    g = False

VIPAdmitTableAdapter.UpdateQuery(g)



粗线*具有错误:"namingcontainer"不是"DevExpress.XtraEditors.CheckEdit"的成员.



最好的问候



bold line * has error: ''namingcontainer '' is not a member of ''DevExpress.XtraEditors.CheckEdit''



best regards

推荐答案

chkStatus的类型为DevExpress.XtraEditors.CheckEdit.您是这样铸造的.只是一个猜测,但它可能没有名为NamingContainer的属性
chkStatus is of type DevExpress.XtraEditors.CheckEdit. You cast it as such. Just a guess, but it probably doesn''t have a property called NamingContainer


这篇关于将布尔参数发送到TableAdapter的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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