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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:29:01+00:00 2026-06-17T17:29:01+00:00

I’ve got this project that I wrote in VS2010 as a WinForms project. I’m

  • 0

I’ve got this project that I wrote in VS2010 as a WinForms project. I’m not writing it in VS2012 as a WPF project. I have a referenced DLL (DailyReport). Inside DailyReport is a method called GetUniqueDates(). It looks like this:

    public List<string> GetUniquesDates()
    {
        var dates = new List<string>();

        const string query = "SELECT date FROM hdd_local_data_v1_2";

        try
        {
            // Exception here  on the connection creation
            using (var connection = new SqlConnection(ConnectionStringFile)) 
            {
                using (var command = new SqlCommand(query, connection))
                {
                    connection.Open();

                    using (var reader = command.ExecuteReader())
                    {
                        while (reader.Read())
                        {
                            for (var i = 0; i < reader.FieldCount; i++)
                            {
                                dates.Add(reader.GetValue(i).ToString());
                            }
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {         
            Logger.Error(ex.Message);
        }

        dates.Sort();

        return dates.Distinct().ToList();
    }

The ConnectionStringFile is set in the constructor, and looks like this:

ConnectionStringFile = @"Data Source=C:\hdd_data\Rubicon.hdd;Version=3;New=False;Compress=True;";

Now, in my VS2010 WinForms project, this method worked just fine. However, in my VS2012 WPF project, I get an exception where I noted above. And the exception is:

keyword not supported 'version'.

The database is a SQLite database. I’ve tried removing the version keyword, but then I’d get the exception:

keyword not supported 'new'.

My question is: Why would the connection work in my WinForms project and not my WPF project? Is there something that changed when dealing with database connections?

Also, please note, this isn’t a question about parameterized queries and the like. So, if possible, please those comments to yourself. Thank you.

  • 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-17T17:29:02+00:00Added an answer on June 17, 2026 at 5:29 pm

    The issue I was having was because I was trying to create a SqlConnection instead of a SQLiteConnection. Making that change solved my issue.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I know there's a lot of other questions out there that deal with this

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.