HTML Code:
Tportera,12/25/2010,12/26/2010,12/27/2010,12/28/2010,12/29/2010,12/30/2010,12/31/2010
1Flygplan,11Kr12Kr,13Kr14Kr,15Kr16Kr,17Kr18Kr,19Kr20Kr,21Kr22Kr,23Kr24Kr
2Flygplan,21Kr22Kr,23Kr24Kr,25Kr26Kr,27Kr28Kr,29Kr30Kr,31Kr32Kr,33Kr34Kr
3Flygplan,31Kr32Kr,33Kr34Kr,35Kr36Kr,37Kr38Kr,39Kr40Kr,41Kr42Kr,43Kr44Kr
4Flygplan,41Kr42Kr,43Kr44Kr,45Kr46Kr,47Kr48Kr,49Kr50Kr,51Kr52Kr,53Kr54Kr
5Flygplan,51Kr52Kr,53Kr54Kr,55Kr56Kr,57Kr58Kr,59Kr60Kr,61Kr62Kr,63Kr64Kr
3Flygplan,31Kr32Kr,33Kr34Kr,35Kr36Kr,37Kr38Kr,39Kr40Kr,41Kr42Kr,43Kr44Kr
2Flygplan,21Kr22Kr,23Kr24Kr,25Kr26Kr,27Kr28Kr,29Kr30Kr,31Kr32Kr,33Kr34Kr
Code:
Imports System.IO
Public Class Form1
Dim dtFriends As New DataTable
Dim filename As String = ""
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
filename = "C:\Documents and Settings\AVILAJ\Desktop\Test Folder\dt\codes.txt"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim splits As String()
Using sr As StreamReader = New StreamReader(filename)
'read the first line for the table column headers
splits = sr.ReadLine.Split(","c)
For i As Integer = 0 To UBound(splits)
dtFriends.Columns.Add(splits(i))
Next
'read the rest of the lines to add rows to the table
Do While Not sr.EndOfStream
splits = sr.ReadLine.Split(","c)
dtFriends.Rows.Add(splits)
Loop
End Using
Catch ex As Exception
Finally
DataGridView1.DataSource = dtFriends.DefaultView
End Try
DateTimePicker1.Format = DateTimePickerFormat.Custom
DateTimePicker1.CustomFormat = "MM/dd/yyyy"
DateTimePicker2.Format = DateTimePickerFormat.Custom
DateTimePicker2.CustomFormat = "MM/dd/yyyy"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim startDate As Date = DateTimePicker1.Value
Dim endDate As Date = DateTimePicker2.Value
Dim Days As Integer = (endDate - startDate).Days
Dim CurrentDate As Date
For i As Integer = 1 To Days
Try
CurrentDate = startDate.AddDays(Days)
DataGridView1.Columns.Remove(CurrentDate.ToString("MM/dd/yyyy"))
Catch
End Try
Next
End Sub
Bookmarks