Results 1 to 15 of 15

Thread: [RESOLVED] Problems with the DataGridView!!!

Threaded View

  1. #1

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

    Resolved [RESOLVED] Problems with the DataGridView!!!

    I want to fetch some data from the database to the DataGridView,so i did this code:
    Code:
    Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Etech.mdb"
            Dim myConnection As OleDbConnection = New OleDbConnection
            myConnection.ConnectionString = connString
            Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select LAcNo,IssuerName,Creditor,Amount,ROI,EMIAmount,BankAcNo,CreditCardNo,Notes from MLoan", myConnection)
            Dim ds As DataSet = New DataSet
            DataGridView1.Columns(0).DataPropertyName = "LAcNo"
            DataGridView1.Columns(1).DataPropertyName = "IssuerName"
            DataGridView1.Columns(2).DataPropertyName = "Creditor"
            DataGridView1.Columns(3).DataPropertyName = "Amount"
            DataGridView1.Columns(4).DataPropertyName = "ROI"
            DataGridView1.Columns(5).DataPropertyName = "EMIAmount"
            DataGridView1.Columns(6).DataPropertyName = "BankAcNo"
            DataGridView1.Columns(7).DataPropertyName = "CreditCardNo"
            DataGridView1.Columns(8).DataPropertyName = "Notes"
            da.Fill(ds, "MLoan")
            Dim dt As New DataTable
            da.Fill(dt)
            DataGridView1.DataSource = dt
    Now in the select statement i want to apply a condition that select only those rows from the database where ReminderDate=TodayDate

    The date format in my access database is like this:
    Attachment 73017
    but i cant build up the select statement.....the select statement that i gave above,what will be the where portion then?
    ReminderDate=Today.Date will wont work i wish;then what will be the where portion in my select query?
    Last edited by gautamshaw; Feb 21st, 2010 at 01:21 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