|
|
 |
 |
|
Join the Discussion
|
Is this the kind of article that helps you?
Let us know!
|
|
 |
 |
|
|
 |
 |
 |
|
|
 |
Download the code
'Imports OleDb namespace
Imports System.Data.OleDb
Public Class frmAboutVBSpotlights
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Dim I As Integer = 0
Dim dteAboutVBDate(10000) As Date
Dim strAboutVBDesc(10000) As String
Dim blnAboutVB6(10000) As Boolean
Dim blnAboutVBNet(10000) As Boolean
Dim urlAboutVBURL(10000) As String
Private Sub frmAboutVBSpotlights_Load( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim strAboutVBConn As String = _
"Provider=Microsoft.Jet.OLEDB.4.0;" _
& "User ID=Admin;" _
& "{path}\"AboutVB.mdb"
Dim ocmdAboutVBCommand As OleDbCommand
Dim odtrAboutVBDataReader As OleDbDataReader
Try
ocmdAboutVBCommand = New OleDbCommand()
With ocmdAboutVBCommand
.Connection = New _
OleDbConnection(strAboutVBConn)
.Connection.Open()
.CommandText = "Select * From Articles"
odtrAboutVBDataReader = .ExecuteReader()
End With
With lstAboutVBData
.Items.Clear()
.BeginUpdate()
Do While odtrAboutVBDataReader.Read
.Items.Add(odtrAboutVBDataReader.GetString(1))
dteAboutVBDate(I) = _
odtrAboutVBDataReader.GetDateTime(2)
strAboutVBDesc(I) = _
odtrAboutVBDataReader.GetString(3)
blnAboutVB6(I) = _
odtrAboutVBDataReader.GetBoolean(4)
blnAboutVBNet(I) = _
odtrAboutVBDataReader.GetBoolean(5)
urlAboutVBURL(I) = _
Mid(odtrAboutVBDataReader.GetString(6), 2, _
Len(odtrAboutVBDataReader.GetString(6)) - 2)
I += 1
Loop
.EndUpdate()
End With
Catch oexpData As OleDb.OleDbException
lblDesc.Text = oexpData.Message
Exit Sub
End Try
odtrAboutVBDataReader.Close()
ocmdAboutVBCommand.Connection.Close()
ReDim Preserve urlAboutVBURL(I - 1)
lstAboutVBData.SelectedIndex = 0
lblDate.Text = dteAboutVBDate(0)
lblDesc.Text = strAboutVBDesc(0)
lblVB6.Text = blnAboutVB6(0)
lblVBNET.Text = blnAboutVBNet(0)
lblURL.Text = urlAboutVBURL(0)
End Sub
Private Sub lstAboutVBData_SelectedIndexChanged( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles lstAboutVBData.SelectedIndexChanged
I = lstAboutVBData.SelectedIndex
lblDate.Text = dteAboutVBDate(I)
lblDesc.Text = strAboutVBDesc(I)
lblVB6.Text = blnAboutVB6(I)
lblVBNET.Text = blnAboutVBNet(I)
lblURL.Text = urlAboutVBURL(I)
End Sub
End Class
First page >
Starting at the beginning ... > Page
1,
2,
3,
4,
5,
6
|