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 6245817
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:34:34+00:00 2026-05-24T12:34:34+00:00

i am using asp.net 2.0 and database is Mysql and i am passing null

  • 0

i am using asp.net 2.0 and database is Mysql and
i am passing null value using datetime datatype to mysql table like this duedate is datetime

if (ddlTerms.SelectedItem.Text.ToString() != "--Select--")
   {
     DateTime createDate = DateTime.Now.AddDays(Convert.ToDouble(ddlTerms.SelectedValue));
     oInvHeader.DueDate = createDate;
   }
   else
   {
    oInvHeader.DueDate =(how to write the code here)
   }

in invoiceHeader.cs code

using System;
using System.Data;
using MySql.Data.MySqlClient;
using System.Text;

 private DateTime m_DueDate;

public DateTime DueDate
        {
            get
            {
                return m_DueDate;
            }
            set
            {
                m_DueDate = value;
            }
        }

pls help me
thank u
hemanth

  • 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-05-24T12:34:34+00:00Added an answer on May 24, 2026 at 12:34 pm

    First of all your DueDate property should be nullable to accept a null value.

    Then you can assign the null value like..

    oInvHeader.DueDate = null;
    

    Here is, how we declare a nullable variable

    DateTime? DueDate;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.NET C# with mySql database. What is the best way for
I am using NHibernate/Fluent NHibernate in an ASP.NET MVC app with a MySQL database.
I'm using ASP.net and an SQL database. I have a blog like system where
I am using ASP.NET MVC2 on top of a MySQL database in VS2008. I
I'm trying to connect to a MySQL database using my ASP.NET Web Forms Application.
I am using MySQL database to work in ASP.NET MVC 3, i've already set
I am using asp.net and c# in my application and Mysql as Database.I want
I'm creating a website in ASP.net and using a MySQL database. What would you
I'm building a website in ASP.net and using a database in mysql. Now I
I need to develop web application using ASP.net with C# to handle mysql database

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.