我是Vb.net的新手。
我的任务是将网站从Vs 2008升级到VS 2012.
如果我从这里得到一些帮助,我将非常感激。
我发布了我的代码,我不明白dbaccess是什么,因此,我收到很多错误
Imports System.Data
Imports Authenciate
Imports System
Imports System.IO
Imports System.Text
Imports System.Data.SqlClient
Public Class Functions
Enum enumType
eProject
eNonproject
End Enum
Enum enumTimeFormat
HH_MM_SS
HH_MM
End Enum
Public Function CrossTabCustomerWise(ByVal FromDate As String, ByVal ToDate As String, ByVal DeptId As Long, Optional ByVal Empcode As String = "") As Object
Dim strSQL As New System.Text.StringBuilder '= "SELECT * FROM t3_viewSummary where logdate between " & "'" & FromDate & "' AND '" & ToDate & "' "
Dim strQuery As New System.Text.StringBuilder
'strQuery.Append(" SELECT Customer FROM t3_forCrossTable ")
strQuery.Append(" where Shiftdate between ''" & FromDate & "'' AND ''" & ToDate & "'' ")
If Empcode <> "" Then
strQuery.Append(" And EmpCode = ''" & Empcode & "''")
End If
If DeptId <> 0 Then
strQuery.Append(" And DeptID = " & DeptId & " ")
End If
strSQL.Append(" EXEC t3_crosstab ")
strSQL.Append(" ' ")
strSQL.Append(" SELECT Customer FROM t3_forCrossTable ")
strSQL.Append(strQuery)
strSQL.Append(" GROUP BY Customer order by customer ', ")
strSQL.Append(" 'sum((Hrs * 60) + mins)', 'substring(cast(ShiftDate as varchar(20)),1,11) ', ")
strSQL.Append(" '")
strSQL.Append("(")
strSQL.Append(" SELECT Customer,Shiftdate FROM t3_forCrossTable ")
strSQL.Append(strQuery)
strSQL.Append(")")
strSQL.Append("t3_forCrossTable")
strSQL.Append("' ")
Return (New DbAccess).ReturnDataTable(strSQL.ToString, strConnAsAdmin)
End Function