gpt4 book ai didi

dataset - 从 vb.net 中的数据集中过滤记录

转载 作者:行者123 更新时间:2023-12-02 02:11:47 25 4
gpt4 key购买 nike

我要从数据集中过滤值 .它包含以零和非零值开头的电话号码。如何从数据集中过滤电话号码(以非零开头)。下面是 vb.net 代码和由此产生的错误。

cmd = New OracleCommand("select  PHONE from  reports.renewal_contact_t where run_date=to_date('" + TextBox1.Text + "','mm/dd/yyyy') and  EXP_DATE =to_date('" + TextBox2.Text + "','mm/dd/yyyy') and  region not in('TNP')", cn)
ada = New OracleDataAdapter(cmd)
ada.Fill(ds, "reports.renewal_contact_t ")
Dim ds1 As New DataSet
ds1.Tables("reports.renewal_contact_t").DefaultView.RowFilter = "PHONE NOT like'0'"

错误:你调用的对象是空的。行过滤器行中的错误

最佳答案

在您的 ds1 中有 无表 *reports.renewal_contact_t*。将其更改为

cmd = New OracleCommand("select  PHONE from  reports.renewal_contact_t where run_date=to_date('" + TextBox1.Text + "','mm/dd/yyyy') and  EXP_DATE =to_date('" + TextBox2.Text + "','mm/dd/yyyy') and  region not in('TNP')", cn)
ada = New OracleDataAdapter(cmd)
ada.Fill(ds, "reports.renewal_contact_t")
' no need for a new dataset - as you fill ds (and not ds1)!!
ds.Tables("reports.renewal_contact_t").DefaultView.RowFilter = "PHONE NOT like'0'"

关于dataset - 从 vb.net 中的数据集中过滤记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12419053/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com