.Net

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Npoornima
    New Member
    • Sep 2006
    • 1

    .Net

    Hi All

    I have to connect MS Access database to work with VB.Net ,
    Even though my codings are correct, iam getting error while worlking
    with my PC.
    I had shown my codings and the error message below.


    Imports System.Data.Ole Db
    Public Class Form1
    Inherits System.Windows. Forms.Form

    Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
    Try
    Dim conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;DATA Source=E:\db1.m db;")
    Dim cmd As New OleDbCommand("S elect * from Table1", conn)
    conn.Open()
    Dim da As New OleDbDataAdapte r(cmd)
    Dim ds As New DataSet
    da.Fill(ds)
    DataGrid1.DataS ource = ds.Tables(0)
    Catch ex As Exception
    MsgBox(ex.ToStr ing)
    End Try
    End Sub
    End Class
  • syedwna
    New Member
    • Aug 2006
    • 11

    #2
    bind the data to datagrid

    datagrid1.datab ind()

    Comment

    • nmsreddi
      Contributor
      • Jul 2006
      • 366

      #3
      hello

      As you are using access database first you requiere security options made to your access other wise it wont allow you to login the database make sure that first



      goodluck

      nmsreddi

      Comment

      • sainin
        New Member
        • Sep 2006
        • 13

        #4
        Can you be more specific with the Error Message??

        Comment

        Working...