Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.38 KB | None | 0 0
  1. Public Function Bar_Task_Cat() As String
  2. Dim Conn As SqlConnection = New SqlConnection(MSSQLstring)
  3. Conn.Open()
  4.  
  5. Dim strUserCode = CType(Session("usrCd"), String)
  6.  
  7. Dim SQLstring As String
  8.  
  9. If strUserCode = "ADMIN" Then
  10. SQLstring = "SELECT COUNT(AskAOID) AS credits, CatCode AS category, ProductCode " _
  11. & "FROM dbo.AskAO_Stats " _
  12. & "WHERE (FirstResponse BETWEEN '" & dpFrom.SelectedDate.ToString & "' AND '" & dpTo.SelectedDate.ToString & "') " _
  13. & "AND (FirstResponse IS NOT NULL) AND (CatCode IS NOT NULL) AND (ProductCode IS NOT NULL) " _
  14. & "GROUP BY ProductCode, CatCode " _
  15. & "ORDER BY CatCode"
  16. Else
  17. SQLstring = "SELECT COUNT(AskAOID) AS credits, CatCode AS category, ProductCode " _
  18. & "FROM dbo.AskAO_Stats " _
  19. & "WHERE (FirstResponse BETWEEN '" & dpFrom.SelectedDate.ToString & "' AND '" & dpTo.SelectedDate.ToString & "') " _
  20. & "AND (Deferred = '" & strUserCode & "') " _
  21. & "AND (FirstResponse IS NOT NULL) AND (CatCode IS NOT NULL) AND (ProductCode IS NOT NULL) " _
  22. & "GROUP BY ProductCode, CatCode " _
  23. & "ORDER BY CatCode"
  24. End If
  25.  
  26. Dim SQLcmd As SqlCommand = New SqlCommand(SQLstring, Conn)
  27. Dim DA As New SqlDataAdapter(SQLstring, Conn)
  28. Dim DS As New DataSet
  29. DA.Fill(DS)
  30.  
  31. Conn.Close()
  32.  
  33. Dim Def_Color_t(12) As String
  34. Def_Color_t(0) = "AFD8F8"
  35. Def_Color_t(1) = "F6BD0F"
  36. Def_Color_t(2) = "8BBA00"
  37. Def_Color_t(3) = "FF8E46"
  38. Def_Color_t(4) = "008E8E"
  39. Def_Color_t(5) = "D64646"
  40. Def_Color_t(6) = "8E468E"
  41. Def_Color_t(7) = "588526"
  42. Def_Color_t(8) = "B3AA00"
  43. Def_Color_t(9) = "008ED6"
  44. Def_Color_t(10) = "9D080D"
  45. Def_Color_t(11) = "A186BE"
  46. Def_Color_t(12) = "AFD8F8"
  47.  
  48.  
  49. Dim ctr As Integer = 0
  50. Dim ctrD As Integer = 0
  51. Dim ctrM As Integer = 0
  52. Dim ctrF As Integer = 0
  53. Dim ctrA As Integer = 0
  54. Dim ctrO As Integer = 0
  55. Dim m_ctr As Integer = 0
  56. Dim m1_ctr As Integer = 0
  57.  
  58. Dim strXML As String
  59. Dim Cat As String
  60. Dim OldCat As String
  61. Dim strCatName As String
  62.  
  63. Dim ProdCode As String
  64.  
  65. 'counters for Products
  66. Dim ctrDMX(12), ctrMHM(12), ctrFCX(12), ctrAPM(12), ctrPOR(12), ctrONL(12), ctrDVX(12), ctrOTH(12) As String
  67.  
  68. 'counters for Categories
  69. 'Dim ctrOL(12), ctrAR(12), ctrPR(12), ctrST(12), ctrPQ(12), ctrFW(12), ctrOO(12) As String
  70. Dim ctrAR(12), ctrDA(12), ctrDB(12), ctrDC(12), ctrDD(12), ctrDE(12), ctrDF(12), ctrDG(12), ctrDH(12), ctrDI(12), ctrDJ(12), ctrDK(12) As String
  71. Dim ctrDL(12), ctrDM(12), ctrDN(12), ctrDO(12), ctrDP(12), ctrDQ(12), ctrFW(12), ctrOL(12), ctrOO(12), ctrPR(12), ctrPQ(12), ctrST(12) As String
  72.  
  73. strXML = ""
  74. Cat = ""
  75. OldCat = ""
  76. strCatName = ""
  77.  
  78. strXML = strXML & "<chart palette='2' labelDisplay='Rotate' slantLabels='1' showBorder='0' bgColor='FFFFFF,FFFFFF' showPercentValues='1' showPercentInToolTip='1' stack100Percent='1' caption='Percentage of Tasks by Category by Product' shownames='1' showvalues='0' showSum='1' decimals='0' useRoundEdges='1'>"
  79. strXML = strXML & "<categories>"
  80. Do Until ctr = DS.Tables(0).Rows.Count
  81. Cat = DS.Tables(0).Rows(ctr)("category").ToString
  82. If Cat <> OldCat Then
  83. Select Case DS.Tables(0).Rows(ctr)("category").ToString
  84. Case "AR"
  85. strCatName = "AR"
  86. Case "DA"
  87. strCatName = "DA"
  88. Case "DB"
  89. strCatName = "DB"
  90. Case "DC"
  91. strCatName = "DC"
  92. Case "DD"
  93. strCatName = "DD"
  94. Case "DE"
  95. strCatName = "DE"
  96. Case "DF"
  97. strCatName = "DF"
  98. Case "DG"
  99. strCatName = "DG"
  100. Case "DH"
  101. strCatName = "DH"
  102. Case "DI"
  103. strCatName = "DI"
  104. Case "DJ"
  105. strCatName = "DJ"
  106. Case "DK"
  107. strCatName = "DK"
  108. Case "DL"
  109. strCatName = "DL"
  110. Case "DM"
  111. strCatName = "DM"
  112. Case "DN"
  113. strCatName = "DN"
  114. Case "DO"
  115. strCatName = "DO"
  116. Case "DP"
  117. strCatName = "DP"
  118. Case "DQ"
  119. strCatName = "DQ"
  120. Case "FW"
  121. strCatName = "FW"
  122. Case "OL"
  123. strCatName = "OL"
  124. Case "OO"
  125. strCatName = "OO"
  126. Case "PR"
  127. strCatName = "PR"
  128. Case "PQ"
  129. strCatName = "PQ"
  130. Case "ST"
  131. strCatName = "ST"
  132. End Select
  133. strXML = strXML & "<category label='" & strCatName & "' value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  134. m_ctr = m_ctr + 1
  135. End If
  136. OldCat = Cat
  137. ctr = ctr + 1
  138. Loop
  139. strXML = strXML & "</categories>"
  140.  
  141. 'initialize
  142. ctr = 0
  143.  
  144. Do Until ctr = m_ctr
  145. ctrDMX(ctr) = "<set value='0' />" 'This line gives the error
  146. ctrFCX(ctr) = "<set value='0' />"
  147. ctrMHM(ctr) = "<set value='0' />"
  148. ctrPOR(ctr) = "<set value='0' />"
  149. ctrONL(ctr) = "<set value='0' />"
  150. ctrAPM(ctr) = "<set value='0' />"
  151. ctrDVX(ctr) = "<set value='0' />"
  152. ctrOTH(ctr) = "<set value='0' />"
  153. ctr = ctr + 1
  154. Loop
  155.  
  156. ctr = 0
  157. Cat = ""
  158. OldCat = DS.Tables(0).Rows(0)("category").ToString
  159.  
  160. Do Until ctr = DS.Tables(0).Rows.Count
  161. ProdCode = DS.Tables(0).Rows(ctr)("ProductCode").ToString
  162.  
  163. Cat = DS.Tables(0).Rows(ctr)("category").ToString
  164.  
  165. If Cat <> OldCat Then
  166. m1_ctr = m1_ctr + 1
  167. End If
  168.  
  169. Select Case ProdCode
  170. Case "DMX"
  171. ctrDMX(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  172. Case "FCX"
  173. ctrFCX(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  174. Case "MHM"
  175. ctrMHM(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  176. Case "POR"
  177. ctrPOR(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  178. Case "ONL"
  179. ctrONL(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  180. Case "APM"
  181. ctrAPM(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  182. Case "DVX"
  183. ctrDVX(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  184. Case "OTH"
  185. ctrOTH(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("credits").ToString & "' />"
  186. End Select
  187.  
  188. OldCat = Cat
  189.  
  190. ctr = ctr + 1
  191. Loop
  192.  
  193. ctr = 0
  194. strXML = strXML & "<dataset seriesName='AMS Device' color='AFD8F8' showValues='0'>" 'Documentation
  195. Do Until ctr = m_ctr
  196. strXML = strXML & ctrDMX(ctr)
  197. ctr = ctr + 1
  198. Loop
  199. strXML = strXML & "</dataset>"
  200.  
  201. ctr = 0
  202. strXML = strXML & "<dataset seriesName='Field Communicator' color='8BBA00' showValues='0'>" 'Documentation
  203. Do Until ctr = m_ctr
  204. strXML = strXML & ctrFCX(ctr)
  205. ctr = ctr + 1
  206. Loop
  207. strXML = strXML & "</dataset>"
  208.  
  209. ctr = 0
  210. strXML = strXML & "<dataset seriesName='Machinery Health' color='F6BD0F' showValues='0'>" 'Documentation
  211. Do Until ctr = m_ctr
  212. strXML = strXML & ctrMHM(ctr)
  213. ctr = ctr + 1
  214. Loop
  215. strXML = strXML & "</dataset>"
  216.  
  217. ctr = 0
  218. strXML = strXML & "<dataset seriesName='Portables' color='AFD8F8' showValues='0'>" 'Documentation
  219. Do Until ctr = m_ctr
  220. strXML = strXML & ctrPOR(ctr)
  221. ctr = ctr + 1
  222. Loop
  223. strXML = strXML & "</dataset>"
  224.  
  225. ctr = 0
  226. strXML = strXML & "<dataset seriesName='Online' color='A186BE' showValues='0'>" 'Documentation
  227. Do Until ctr = m_ctr
  228. strXML = strXML & ctrONL(ctr)
  229. ctr = ctr + 1
  230. Loop
  231. strXML = strXML & "</dataset>"
  232.  
  233. ctr = 0
  234. strXML = strXML & "<dataset seriesName='Asset Portal' color='FF8E46' showValues='0'>" 'Documentation
  235. Do Until ctr = m_ctr
  236. strXML = strXML & ctrAPM(ctr)
  237. ctr = ctr + 1
  238. Loop
  239. strXML = strXML & "</dataset>"
  240.  
  241. ctr = 0
  242. strXML = strXML & "<dataset seriesName='DeltaV' color='9D080D' showValues='0'>" 'Documentation
  243. Do Until ctr = m_ctr
  244. strXML = strXML & ctrDVX(ctr)
  245. ctr = ctr + 1
  246. Loop
  247. strXML = strXML & "</dataset>"
  248.  
  249. ctr = 0
  250. strXML = strXML & "<dataset seriesName='Others' color='008E8E' showValues='0'>" 'Documentation
  251. Do Until ctr = m_ctr
  252. strXML = strXML & ctrOTH(ctr)
  253. ctr = ctr + 1
  254. Loop
  255. strXML = strXML & "</dataset>"
  256.  
  257. strXML = strXML & "</chart>"
  258.  
  259. 'Create the chart - Column 3D Chart with data from strXML variable using dataXML method
  260. Return RenderChartHTML("Charts/NewCharts/StackedColumn3D.swf", "", strXML, "myNext", "450", "500", False)
  261. 'for gauge
  262.  
  263. End Function
  264.  
  265. Public Function FRTChart() As String
  266. Dim Conn As SqlConnection = New SqlConnection(MSSQLstring)
  267. Conn.Open()
  268.  
  269. Dim strUserCode = CType(Session("usrCd"), String)
  270.  
  271. Dim SQLstring As String
  272.  
  273. If strUserCode = "ADMIN" Then
  274. SQLstring = "SELECT Count(FirstResponse) AS TotalQueries, SUBSTRING(CONVERT(VARCHAR(11), FirstResponse, 113), 4, 8) AS Month, RIGHT(CONVERT(VARCHAR(7), FirstResponse , 120), 2) AS Month_Order, CAST(YEAR(FirstResponse) AS VARCHAR(4)) AS Year, " _
  275. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) <= 2 THEN 1 ELSE 0 END) AS LessThan2Hours, " _
  276. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 3 AND 24 THEN 1 ELSE 0 END) AS LessThan24Hours, " _
  277. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 25 AND 48 THEN 1 ELSE 0 END) AS LessThan48Hours, " _
  278. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 49 AND 72 THEN 1 ELSE 0 END) AS LessThan72Hours, " _
  279. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 73 AND 96 THEN 1 ELSE 0 END) AS LessThan96Hours, " _
  280. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) > 96 THEN 1 ELSE 0 END) AS Over96Hours " _
  281. & "FROM [AskAO].dbo.AskAO_Stats " _
  282. & "WHERE (FirstResponse BETWEEN '" & dpFrom.SelectedDate.ToString & "' AND '" & dpTo.SelectedDate.ToString & "') " _
  283. & "AND (Status = 'CLOSED' OR Status = 'ACTIVE') " _
  284. & "AND (FirstResponse IS NOT NULL) " _
  285. & "GROUP BY SUBSTRING(CONVERT(VARCHAR(11), FirstResponse , 113), 4, 8), CONVERT(VARCHAR(7), FirstResponse , 120), CAST(YEAR(FirstResponse) AS VARCHAR(4)) " _
  286. & "ORDER BY Year, Month_Order"
  287. Else
  288. SQLstring = "SELECT Count(FirstResponse) AS TotalQueries, SUBSTRING(CONVERT(VARCHAR(11), FirstResponse, 113), 4, 8) AS Month, RIGHT(CONVERT(VARCHAR(7), FirstResponse , 120), 2) AS Month_Order, CAST(YEAR(FirstResponse) AS VARCHAR(4)) AS Year, " _
  289. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) <= 2 THEN 1 ELSE 0 END) AS LessThan2Hours, " _
  290. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 3 AND 24 THEN 1 ELSE 0 END) AS LessThan24Hours, " _
  291. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 25 AND 48 THEN 1 ELSE 0 END) AS LessThan48Hours, " _
  292. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 49 AND 72 THEN 1 ELSE 0 END) AS LessThan72Hours, " _
  293. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) between 73 AND 96 THEN 1 ELSE 0 END) AS LessThan96Hours, " _
  294. & "SUM(CASE WHEN DATEDIFF(HOUR, Date_Sent, FirstResponse) > 96 THEN 1 ELSE 0 END) AS Over96Hours " _
  295. & "FROM [AskAO].dbo.AskAO_Stats " _
  296. & "WHERE (FirstResponse BETWEEN '" & dpFrom.SelectedDate.ToString & "' AND '" & dpTo.SelectedDate.ToString & "') " _
  297. & "AND (Status = 'CLOSED' OR Status = 'ACTIVE') AND (Deferred = '" & strUserCode & "') " _
  298. & "AND (FirstResponse IS NOT NULL) " _
  299. & "GROUP BY SUBSTRING(CONVERT(VARCHAR(11), FirstResponse , 113), 4, 8), CONVERT(VARCHAR(7), FirstResponse , 120), CAST(YEAR(FirstResponse) AS VARCHAR(4)) " _
  300. & "ORDER BY Year, Month_Order"
  301. End If
  302.  
  303. Dim SQLcmd As SqlCommand = New SqlCommand(SQLstring, Conn)
  304. Dim DA As New SqlDataAdapter(SQLstring, Conn)
  305. Dim DS As New DataSet
  306. DA.Fill(DS)
  307.  
  308. Dim Def_Color_t(12) As String
  309. Def_Color_t(0) = "AFD8F8"
  310. Def_Color_t(1) = "F6BD0F"
  311. Def_Color_t(2) = "8BBA00"
  312. Def_Color_t(3) = "FF8E46"
  313. Def_Color_t(4) = "008E8E"
  314. Def_Color_t(5) = "D64646"
  315. Def_Color_t(6) = "8E468E"
  316. Def_Color_t(7) = "588526"
  317. Def_Color_t(8) = "B3AA00"
  318. Def_Color_t(9) = "008ED6"
  319. Def_Color_t(10) = "9D080D"
  320. Def_Color_t(11) = "A186BE"
  321. Def_Color_t(12) = "AFD8F8"
  322.  
  323.  
  324. Dim ctr As Integer = 0
  325. Dim ctrD As Integer = 0
  326. Dim ctrM As Integer = 0
  327. Dim ctrF As Integer = 0
  328. Dim ctrA As Integer = 0
  329. Dim ctrO As Integer = 0
  330. Dim m_ctr As Integer = 0
  331. Dim m1_ctr As Integer = 0
  332.  
  333. Dim strXML As String
  334. Dim CatMonth As String
  335. Dim OldMonth As String
  336.  
  337. Dim ctr2(12), ctr24(12), ctr48(12), ctr72(12), ctr96(12), ctro96(12) As String
  338.  
  339. strXML = ""
  340. CatMonth = ""
  341. OldMonth = ""
  342.  
  343. strXML = strXML & "<chart palette='2' legendPosition='RIGHT' labelDisplay='Rotate' slantLabels='1' showBorder='0' bgColor='FFFFFF,FFFFFF' caption='First Response Time' shownames='1' showvalues='0' showSum='1' decimals='0' useRoundEdges='1' showPercentValues='1' showPercentInToolTip='1'>"
  344. strXML = strXML & "<categories>"
  345. Do Until ctr = DS.Tables(0).Rows.Count
  346. CatMonth = DS.Tables(0).Rows(ctr)("Month").ToString
  347. If CatMonth <> OldMonth Then
  348. strXML = strXML & "<category label='" & DS.Tables(0).Rows(ctr)("Month").ToString & "' value='" & DS.Tables(0).Rows(ctr)("TotalQueries").ToString & "' />"
  349. m_ctr = m_ctr + 1
  350. End If
  351. OldMonth = CatMonth
  352. ctr = ctr + 1
  353. Loop
  354. strXML = strXML & "</categories>"
  355.  
  356. 'initialize
  357. ctr = 0
  358.  
  359. Do Until ctr = m_ctr
  360. ctr2(ctr) = "<set value='0' />"
  361. ctr24(ctr) = "<set value='0' />"
  362. ctr48(ctr) = "<set value='0' />"
  363. ctr72(ctr) = "<set value='0' />"
  364. ctr96(ctr) = "<set value='0' />"
  365. ctro96(ctr) = "<set value='0' />"
  366. ctr = ctr + 1
  367. Loop
  368.  
  369. ctr = 0
  370. CatMonth = ""
  371. OldMonth = DS.Tables(0).Rows(0)("Month").ToString 'This line gives the error
  372.  
  373. Do Until ctr = DS.Tables(0).Rows.Count
  374. 'ProdCode = DS.Tables(0).Rows(ctr)("ProductCode").ToString
  375. 'respTime = DS.Tables(0).Rows(ctr)("ResponseTime")
  376.  
  377. CatMonth = DS.Tables(0).Rows(ctr)("Month").ToString
  378.  
  379. If CatMonth <> OldMonth Then
  380. m1_ctr = m1_ctr + 1
  381. End If
  382.  
  383. ctr2(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("LessThan2Hours").ToString & "' />"
  384. ctr24(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("LessThan24Hours").ToString & "' />"
  385. ctr48(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("LessThan48Hours").ToString & "' />"
  386. ctr72(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("LessThan72Hours").ToString & "' />"
  387. ctr96(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("LessThan96Hours").ToString & "' />"
  388. ctro96(m1_ctr) = "<set value='" & DS.Tables(0).Rows(ctr)("Over96Hours").ToString & "' />"
  389.  
  390. OldMonth = CatMonth
  391.  
  392. ctr = ctr + 1
  393. Loop
  394.  
  395. ctr = 0
  396. strXML = strXML & "<dataset seriesName='2 Hrs' color='AFD8F8' showValues='0'>" 'Documentation
  397. Do Until ctr = m_ctr
  398. strXML = strXML & ctr2(ctr)
  399. ctr = ctr + 1
  400. Loop
  401. strXML = strXML & "</dataset>"
  402.  
  403. ctr = 0
  404. strXML = strXML & "<dataset seriesName='24 Hrs' color='8BBA00' showValues='0'>" 'Documentation
  405. Do Until ctr = m_ctr
  406. strXML = strXML & ctr24(ctr)
  407. ctr = ctr + 1
  408. Loop
  409. strXML = strXML & "</dataset>"
  410.  
  411. ctr = 0
  412. strXML = strXML & "<dataset seriesName='24 - 48 Hrs' color='F6BD0F' showValues='0'>" 'Documentation
  413. Do Until ctr = m_ctr
  414. strXML = strXML & ctr48(ctr)
  415. ctr = ctr + 1
  416. Loop
  417. strXML = strXML & "</dataset>"
  418.  
  419. ctr = 0
  420. strXML = strXML & "<dataset seriesName='48 - 72 Hrs' color='008E8E' showValues='0'>" 'Documentation
  421. Do Until ctr = m_ctr
  422. strXML = strXML & ctr72(ctr)
  423. ctr = ctr + 1
  424. Loop
  425. strXML = strXML & "</dataset>"
  426.  
  427. ctr = 0
  428. strXML = strXML & "<dataset seriesName='72 - 96 Hrs' color='A186BE' showValues='0'>" 'Documentation
  429. Do Until ctr = m_ctr
  430. strXML = strXML & ctr96(ctr)
  431. ctr = ctr + 1
  432. Loop
  433. strXML = strXML & "</dataset>"
  434.  
  435. ctr = 0
  436. strXML = strXML & "<dataset seriesName='Over 96 Hrs' color='FF8E46' showValues='0'>" 'Documentation
  437. Do Until ctr = m_ctr
  438. strXML = strXML & ctro96(ctr)
  439. ctr = ctr + 1
  440. Loop
  441. strXML = strXML & "</dataset>"
  442.  
  443. strXML = strXML & "</chart>"
  444.  
  445. 'Create the chart - Column 3D Chart with data from strXML variable using dataXML method
  446. Return RenderChartHTML("Charts/NewCharts/StackedColumn3D.swf", "", strXML, "myNext", "450", "370", False)
  447. 'for gauge
  448.  
  449. End Function
  450.  
  451. Do Until ctr = m_ctr
  452. ctrDMX(ctr) = "<set value='0' />" 'This line gives the error
  453.  
  454. OldMonth = DS.Tables(0).Rows(0)("Month").ToString 'This line gives the error
  455.  
  456. If DS.Tables(0).Rows(0) >= 1 Then
  457. OldMonth = DS.Tables(0).Rows(0)("Month").ToString 'This line gives the error
  458. Else
  459. OldMonth = String.Empty
  460. End If
  461.  
  462. Dim SQLcmd As SqlCommand = New SqlCommand(SQLstring, Conn)
  463. SQLcmd.Parameters.AddWithValue("@dateFrom", dpFrom.SelectedDate)
  464. SQLcmd.Parameters.AddWithValue("@dateTo", dpTo.SelectedDate)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement