Advertisement
Advertisement
| 06.18.2008 at 05:59PM PDT, ID: 23497423 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: |
If CheckBox1.CheckState = CheckState.Checked Then
connectionString2 = "data source='" & ComboServers.Text & "'; Initial catalog=master;Integrated Security = True;"
cnn2 = New SqlConnection(connectionString2)
cnn2.Open()
sql2 = "Select * from master.dbo.temp_Filter_by_error where [Error Description] in ('Could not index file') order by [fileset ID],[Doc ID]"
Dim dscmd2 As New SqlDataAdapter(sql2, cnn2)
Dim ds2 As New DataSet
dscmd2.Fill(ds2)
.Worksheets(3).Select()
CType(Excel.Workbooks(1).Worksheets("Sheet3"), Microsoft.Office.Interop.Excel.Worksheet).Name = "Index Error Report"
Dim m As Integer = 1
For col = 0 To ds2.Tables(0).Columns.Count - 1
.cells(1, m).value = ds2.Tables(0).Columns(col).ColumnName
.cells(1, m).EntireRow.Font.Bold = True
m += 1
Next
m = 2
Dim n As Integer = 1
For col = 0 To ds2.Tables(0).Columns.Count - 1
m = 2
For row = 0 To ds2.Tables(0).Rows.Count - 1
.Cells(m, n).Value = ds2.Tables(0).Rows(row).ItemArray(col)
m += 1
Next
n += 1
Next
End If
|