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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:48:03+00:00 2026-05-17T19:48:03+00:00

I am developing mobile application in C#. I am using the SQLite database to

  • 0

I am developing mobile application in C#. I am using the SQLite database to store the data. In the SQLite database I am storing the information related to the customer. In that I am storing the date with mm/dd/yy 12:54:30 PM format. Now I want to retrive the customer data based on start date & end date. I am using the following code

ShowRegistrationKeyDetails ShowRegKeyDetailsObj = new ShowRegistrationKeyDetails();
// set properties
          ShowRegKeyDetailsObj.FromDate = FromdateTimePicker.Value.ToString();
        ShowRegKeyDetailsObj.ToDate = TodateTimePicker.Value.ToString();

When I fire the SQL Queries based on these values I am not getting the proper result. I need to convert the above values of FromdateTimePicker.Text & TodateTimePicker.Text into the mm/dd/yy 12:54:30 PM format.
I am using the following code

public SQLiteDataReader getClient_And_RegistrationKeys(int Customer_ID, String FromDt, String ToDt)
    {
        SQLiteDataReader SQLLiteDrObj = null;
        DataManager myDatabase = new DataManager("CompNet.db");
        myDatabase.Init(false);

        string[] Parameter = new string[] { "@Val_Customer_ID", "@Val_FromDt", "@Val_ToDt" };
        Object[] Objval = new Object[] { Customer_ID, FromDt, ToDt };

        string sqlCommandText = "Select Activation_Date, Standard_ID, Client_Key, Registration_Key from Activation_Details where Customer_ID=@Val_Customer_ID And Activation_Date between @Val_FromDt And @Val_ToDt";
        SQLLiteDrObj = myDatabase.ExecuteReader(sqlCommandText, Parameter, Objval);

        return SQLLiteDrObj;
    }

I have tried this code. Now I am getting the date in the format in which I want but I am not getting the required rows as output. There is no row in the output. Where I am going wrong ? Can you please provide me any code?

  • 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-17T19:48:04+00:00Added an answer on May 17, 2026 at 7:48 pm

    Don’t use Text to start with – use DateTimePicker.Value to get the value as a DateTime.

    Ideally, then don’t convert it into text when using SQLite either – use a parameterized query instead of formatting it at all. See this article as one example of using parameterized queries from C# with SQLite.

    As a general rule, try to avoid going through text wherever possible. It’s great for displaying values to users, but lousy for being confident that you’ve got the right data without having to be careful about different formats etc.

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

Sidebar

Related Questions

I am developing windows mobile application. I have added the SQLite database file in
I am developing windows mobile application. I am using the SQLlite database. I am
I am developing an application using Windows Mobile 5.0, under embedded VC++ 4.0, and
I'm developing an application for Windows Mobile Devices using Visual Studio .NET 2008 whose
I am developing a Windows Mobile application using WM6 SDK. The application is a
I'm developing a mobile phone application that targets a lot of mobile devices based
I'm developing a Windows Mobile 5.0 or above WinForm application using .NET Compact Framework
I am developing a mobile application that is to run on a Windows Mobile
I'm developing a Windows Mobile 5.0 and above application using .Net Compact Framework 2.0
I am developing asp.net mobile application. I am using LINQ to XML to query

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.