Results 1 to 12 of 12

Thread: Data Grid coding not working properly!!!

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2009
    Posts
    1,103

    Unhappy Data Grid coding not working properly!!!

    I did this code:
    Code:
    Imports System.Data
    Imports System.Data.OleDb
    Public Class Form1
        Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
            Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Gautam\Documents\Visual Studio 2005\Projects\waste\waste\db1.mdb"
            Dim myConnection As OleDbConnection = New OleDbConnection
            myConnection.ConnectionString = connString
            Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select * from Table1", myConnection)
            Dim ds As DataSet = New DataSet
            da.Fill(ds, "Table1")
            DataGridView1.DataSource = ds.DefaultViewManager
        End Sub
    End Class
    I get this output on button click:
    Attachment 72031

    Where does the error lies in my code?
    Last edited by gautamshaw; Feb 21st, 2010 at 01:22 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width