MSAccess With VB
MSAccess With VB
.NET Defined
OOP with VB
VB Language
Win Forms
Windows Controls
ADO .NET
User Controls
File Handling
Multithreading
Deployment
XML Web Services Essential
XML
Resources
Discussions
ASP.NET
About
Advertisement
DataFlex ODBC
Driver
Easy SQL direct access
to DataFlex database
tables with Windows
apps.
www.flexquarters.com
Free Developer
Version
High End .NET Charting
Component w/ Support
For All Chart Types Now!
www.DotNetCharting.com
ASP.NET Upload
Control
Select and Upload
multiple files Large file
support w/
ProgressPanel
www.AjaxUploader.com
Database
Diagram (ERD)
Database Design &
Modeling: Get: DeZign
for Databases : $129
www.datanamic.com
GoDiagram
Components
Add diagrams and
graphics to your .NET
applications
www.nwoods.com
CodeSmith Code
Generator
Template-driven.
Easy to use. Your
code. Your way.
Faster!
www.codesmithtools.…
Sample Code
Create a database named Emp in Microsoft Access in the C: drive of your machine. In the Emp database create a table, Table1 with EmpNo, EName
and Department as columns, insert some values in the table and close it. Open Visual Studio .NET, on a new form drag three TextBoxes and a Button.
The following code will assume that TextBox1 is for EmpNo, TextBox2 is for EName and TextBox3 is for Department. Our intention is to retrieve data
from Table1 in the Emp Database and display the values in these TextBoxes without binding when the Button is clicked.
When you run the code and click the Button, records from Table1 of the Emp database will be displayed in the TextBoxes.
Imports System.Data.OleDb
Imports System.Console
Module Module1
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Sub Main()
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\emp.mdb;_
Persist Security Info=False")
cn.Open()
cmd = New OleDbCommand("select * from table1", cn)
dr = cmd.ExecuteReader
While dr.Read()
WriteLine(dr(0))
WriteLine(dr(1))
WriteLine(dr(2))
'writing to console
End While
Catch
End Try
dr.Close()
cn.Close()
End Sub
End Module
Imports System.Data.OleDb
Public Class Form2 Inherits System.Windows.Forms.Form
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim dr As OleDbDataReader
Dim icount As Integer
Dim str As String
End Sub
Send Mail from ASP / .NET AspEmail supports Unicode, HTML, encryption, TLS, message queuing. www.aspemail.com
Curso Online de C# Curso ONLINE com Certificação. 3 X R$29,97 c/ Professor e Suporte! www.treinaweb.com.br