Foxtable(狐表)用户栏目专家坐堂 → [推荐][讨论] 提示找不到CRM_SALE,谁帮我找找错误


  共有4437人关注过本帖树形打印复制链接

主题:[推荐][讨论] 提示找不到CRM_SALE,谁帮我找找错误

帅哥哟,离线,有人找我吗?
wuxianzuoji41
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:884 积分:7061 威望:0 精华:0 注册:2013/3/5 8:42:00
[推荐][讨论] 提示找不到CRM_SALE,谁帮我找找错误  发帖心情 Post By:2013/12/23 9:28:00 [显示全部帖子]

dim cmd as SQLCommand

'核算上月工资_____________________________________________________________________________
Dim shangyue As Double=0
Dim y_Shangyue As Integer = Date.Today.Year
Dim m_Shangyue As Integer = Date.Today.Month
Dim dt1_Shangyue As New Date(y_Shangyue, m_Shangyue, 1)
dt1_Shangyue  = dt1_Shangyue.Addmonths(-1)
y_Shangyue = dt1_Shangyue.Year
m_Shangyue = Dt1_Shangyue.Month
Dim FilterShangyue  As String
Dim dt2_Shangyue  As New Date(y_Shangyue, m_Shangyue, Date.DaysInMonth(y_Shangyue, m_Shangyue)) '获取本月的最后一天
FilterShangyue = "(sell_date >= '" & dt1_Shangyue & "' And sell_date <= '" & dt2_Shangyue & "')"
FilterShangyue= "select * from crm_sale left join crm_opportunity on crm_sale.opp_id=crm_opportunity.opp_id Where  seller = '" & _userid & "'and " + FilterShangyue
 e.Form.Controls("txtShangyueticheng").text=FilterShangyue
Dim dt As DataTable
cmd.CommandText = FilterShangyue
dt = cmd.ExecuteReader()
For Each dr2 As DataRow In dt.Datarows
msgbox(dr2("from_id"))
Select Case dr2("from_id")
Case 0,8
shangyue=shangyue+dr2("totalMoney")*0.005
Case 3,12,1,2,4,5,6,7,9,10,11
shangyue=shangyue+dr2("totalMoney")*0.02
Case Else
End Select
Next
e.Form.Controls("txtShangyueticheng").text=shangyue


 回到顶部
帅哥哟,离线,有人找我吗?
wuxianzuoji41
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:884 积分:7061 威望:0 精华:0 注册:2013/3/5 8:42:00
  发帖心情 Post By:2013/12/23 9:57:00 [显示全部帖子]

以下是引用Bin在2013-12-23 9:28:00的发言:
建议您用这个方法:
http://www.foxtable.com/help/topics/1485.htm

先找出是哪一行出错,然后分析原因,搞不定,贴出代码,并告诉我们运行到哪一行出错,以及错误提示。

Dim FilterShangyue  As String
Dim dt2_Shangyue  As New Date(y_Shangyue, m_Shangyue, Date.DaysInMonth(y_Shangyue, m_Shangyue)) '获取本月的最后一天
FilterShangyue = "(sell_date >= '" & dt1_Shangyue & "' And sell_date <= '" & dt2_Shangyue & "')"
FilterShangyue= "select * from crm_sale left join crm_opportunity on crm_sale.opp_id=crm_opportunity.opp_id Where  seller = '" & _userid & "'and " + FilterShangyue
e.Form.Controls("txtShangyueticheng").text=FilterShangyue
Dim dt As DataTable
cmd.CommandText = FilterShangyue
dt = cmd.ExecuteReader()

 

就是到这句的话的时候提示错误 dt = cmd.ExecuteReader()提示提示找不到CRM_SALE

但是我吧e.Form.Controls("txtShangyueticheng").text=FilterShangyue 这个SQL的字符窜放在SQL命令行里是没有错误的


 回到顶部
帅哥哟,离线,有人找我吗?
wuxianzuoji41
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:884 积分:7061 威望:0 精华:0 注册:2013/3/5 8:42:00
  发帖心情 Post By:2013/12/23 10:06:00 [显示全部帖子]

以下是引用Bin在2013-12-23 10:03:00的发言:
如果你用的是外部数据源,你并没有指定数据源.

真晕,谢谢,就是这个问题。


 回到顶部