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

  • Home
  • SEARCH
  • 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 8245197
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:06:13+00:00 2026-06-07T22:06:13+00:00

Having trouble displaying MonthName in a DataGridView from data in MySQL Query: SELECT ItemName,

  • 0

Having trouble displaying MonthName in a DataGridView from data in MySQL

Query:

SELECT ItemName, Description, PurchaseDate, MONTHNAME(PurchaseDate) AS PurchaseMonth FROM tblItems

Error:

System.ArguementException:Parameter is not valid

Displaying the month number, using MONTH(PurchaseDate) works perfect but when I try to show the month name I get a datagrid error. When I run the SQL in MySQL it returns the expected results.

When I add in a DataError event it just shows a red exclimation mark in the fields where MONTHNAME(PurchaseDate) should be.

  • 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-07T22:06:14+00:00Added an answer on June 7, 2026 at 10:06 pm

    Solved it.
    Even though MonthName(PurchaseDate) worked when run directly against the database, I had to use Cast in the SQL string when passing in from VB.NET

    Amended SQL:

    SELECT ItemName, Description, PurchaseDate, CAST(MONTHNAME(PurchaseDate) AS CHAR) AS PurchaseMonth FROM tblItems
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having trouble displaying results from a SQL query. I am trying to
I am having trouble displaying results recieved from asp.net WebMethod. I have a HTML
I'm having trouble with displaying image from db. I think that method for saving
I am having trouble passing the return value from TheMethod() to Main and displaying
I am having trouble displaying an image from the internet on my html page.
I'm having trouble displaying an image in a UIWebView. I retrieve html content from
I am having trouble displaying data in my table. Preamble: TableView placed on the
I'm having trouble displaying my mysql table using php code. All it displays is
I am having trouble displaying a raw YUV file that it is in NV12
I am having trouble displaying Date s in the format I want in my

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.