Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8378715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:59:26+00:00 2026-06-09T15:59:26+00:00

I load a Datatable to a datagrid view by calling the following function: Public

  • 0

I load a Datatable to a datagrid view by calling the following function:

 Public Sub GetData(ByVal selectCommand As String, ByVal bindingSource As BindingSource, ByVal table As DataTable)
    Try
        Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\adm\Desktop\222.mdb"
        Me.dataAdapter = New OleDbDataAdapter(selectCommand, connectionString)
        Dim commandBuilder As New OleDbCommandBuilder(Me.dataAdapter)
        table.Locale = System.Globalization.CultureInfo.InvariantCulture
        Me.dataAdapter.Fill(table)
        bindingSource.DataSource = table
    Catch ex As OleDbException
        MessageBox.Show(ex.Message)
    End Try
End Sub

And here is the function call:

GetData("select * from products where ID=1 or ID=2", bindingSource1, t1)

Now, does the data table define the column types as they are from the source database?
Because when I try to add data to a DateTime column, it says that the column is of type integer but in Access I can see that it is a DateTime Column. So do I need to specify each type for each column or it is done automatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T15:59:27+00:00Added an answer on June 9, 2026 at 3:59 pm

    Check the type of the column in which you are passing the date value make sure that the value is not int.If it so then change it to datetime

    EDIT
    Go to the properties of your datatable and change the column type to datetime

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<script type=text/javascript> google.load('visualization', '1', {packages: ['corechart']}); function drawVisualization() { // Populate the data table.
I have a Datagrid connected to Datatable, which needs to load a very large
I am using firebird .NET provider and when I do something like this: DataTable.Load(FbCommand.ExecuteReader());
I have an excel sheet that I want to load into a datatable withe
How can I load a CSV file into a System.Data.DataTable , creating the datatable
What is the maximum size of a DataTable I can load into memory in
load.js: jQuery(document).ready(function($) { $('.dialog ul li').click(function(e) { switch($(this).attr('id')) { case 'addProject': $('.addDialog').load('/add/addprojectform'); break; case
I have a form which contains a DataGridView, a BindingSource, a DataTable, and a
I have a DataGridView with a BindingSource as it's data source and a DataTable
When I fill a DataGridView row by row (calling it's add function), the top

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.