请找出下面这段程序的错误并修正Public Function getDataFromDB(ByVal strID As String, ByRef tblDT As DataTable) As IntegerDim connStr As String = _System.Configuration.ConfigurationSettings.AppSettings("DBConnectionString")Dim conn As SqlConnectionDim ds As New DataSetDim iRet As Integer = 0Dim sqlDA As SqlDataAdapterDim sqlComm As SqlCommandDim sql As StringIf IsNothing(strID) ThenstrID = String.EmptyEnd IfstrID = strID.Trimconn = New SqlConnection(connStr)Tryconn.Open()sql = "SELECT * FROM WWJB01 WHERE ID LIKE '%" strID "%'"sqlComm = New SqlCommand(sql, conn)sqlDA = New SqlDataAdaptersqlDA.SelectCommand = sqlCommsqlDA.Fill(ds)If Not IsNothing(ds) ThenIf ds.Tables.Count 1 Then tblDT = ds.Tables(0).CopyiRet = ds.Tables(0).Rows.CountEnd IfEnd IfCatch ex As ExceptionThrow exFinallyIf Not conn.State = ConnectionState.Closed Thenconn.Close()conn.Dispose()End IfEnd TryReturn iRetEnd Function
请找出下面这段程序的错误并修正
Public Function getDataFromDB(ByVal strID As String, ByRef tblDT As DataTable) As Integer
Dim connStr As String = _
System.Configuration.ConfigurationSettings.AppSettings("DBConnectionString")
Dim conn As SqlConnection
Dim ds As New DataSet
Dim iRet As Integer = 0
Dim sqlDA As SqlDataAdapter
Dim sqlComm As SqlCommand
Dim sql As String
If IsNothing(strID) Then
strID = String.Empty
End If
strID = strID.Trim
conn = New SqlConnection(connStr)
Try
conn.Open()
sql = "SELECT * FROM WWJB01 WHERE ID LIKE '%" & strID & "%'"
sqlComm = New SqlCommand(sql, conn)
sqlDA = New SqlDataAdapter
sqlDA.SelectCommand = sqlComm
sqlDA.Fill(ds)
If Not IsNothing(ds) Then
If ds.Tables.Count > 1 Then tblDT = ds.Tables(0).Copy
iRet = ds.Tables(0).Rows.Count
End If
End If
Catch ex As Exception
Throw ex
Finally
If Not conn.State = ConnectionState.Closed Then
conn.Close()
conn.Dispose()
End If
End Try
Return iRet
End Function