none
Help meData Reader concept RRS feed

  • Question

  •  

    Hi

     

    I am using Asp.net 2005 application. If i am using sql server backend. I I want to use Datareader concept. At the same time i am using backend in MS Access means Data Reader concept not working... How can to use the Datareader concept in MS Access Database.

     

     

     

    Imports System.Data

    Imports System.Data.OleDb

     

    Public Class Form1

    Dim con As New OleDbConnection

    Dim cmd As New OleDbCommand

    Dim dr as datareader ------------>This command not working.

     

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged

    If ComboBox1.Text = 1 Then

    cmd = New OleDbCommand("select * from personal where empcode='" & TextBox1.Text & "'", con)

    dr = cmd.ExecuteReader()

    End If

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    con = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source:\accesshr.mdb")

    con.Open()

    End Sub

    End Class

    Thursday, February 21, 2008 12:14 PM

All replies