Dim Symbol() As String
Dim Day() As String
Private Sub CheckCompanyNWD()
Try
Conn = New SqlConnection
OpenConn()
Dim sqlComNWD As String
'Symbol(0) = New String("0")
Sb.Remove(0, Sb.Length())
Sb.Append(" SELECT * FROM Tb_Non_Wrk_Day ")
Sb.Append(" WHERE MONTH(Nwd_Date)='" & cbomonth.SelectedIndex & "' AND YEAR(Nwd_Date)='" & cboyear.Text & "' ")
Sb.Append(" ORDER BY Nwd_Date ")
Dim sqlSearchNWD As String
sqlSearchNWD = Sb.ToString()
Dim dtSearchNWD As DataTable
dtSearchNWD = New DataTable
dtSearchNWD = ExecuteReaderReturnDatatTable(sqlSearchNWD)
If dtSearchNWD.Rows.Count > 0 Then
For a As Integer = 0 To dtSearchNWD.Rows.Count - 1
NWD = dtSearchNWD.Rows(a)(0).ToString
Symbol(a) = New String(dtSearchNWD.Rows(a)(1).ToString)
Day(a) = New String(NWD.Day.ToString())
Select Case Symbol(a)
Case "10"
Symbol(a) = New String("V")
Case "20"
Symbol(a) = New String("PH")
Case "30"
Symbol(a) = New String("PH")
Case Else
End Select
Next
End If
CloseConn()
Catch ex As Exception
End Try
End Sub
errorที่บรรทัดนี้ค่ะ Symbol(a) = New String(dtSearchNWD.Rows(a)(1).ToString) ขอบคุณค่ะ
Tag : .NET
Date :
2013-05-25 19:56:29
By :
ninja,aster
View :
793
Reply :
3
No. 1
Guest
ต้นน้ำบรรทัดที่ 1. Dim Symbol() As String 'Size = 0
Dim sb As StringBuilder()
sb = New StringBuilder()
sb.Append("xxx")
sb = New StringBuilder()
sb.Append("yyy")
sb = New StringBuilder()
sb.Append("zzz")