• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

For Ken Haley

Continuation from last post:  C# code used to build the query...

            string selectString = "select COUNT(*) from tBooks where DateU > '" + lastExport.ToString("dd MMM yyyy") + "'";
            traceSource.TraceInformation("selectString: " + selectString);
            traceSource.Flush();

            SqlDataReader rdr = null;
            if (bookConn.State == ConnectionState.Closed)
                bookConn.Open();

            SqlCommand cmd = new SqlCommand(selectString, bookConn);
            rdr = cmd.ExecuteReader();
            rdr.Read();

            lBooksWaiting.Text = rdr[0] + " books waiting to be exported";  //  on import/export tab
            lBooksWaiting.Refresh();

            rdr.Close();


0
rmmarsh
Asked:
rmmarsh
1 Solution
 
REA_ANDREWCommented:
while(rdr.Read())
{
            lBooksWaiting.Text = rdr[0] + " books waiting to be exported";  //  on import/export tab
}

I am a bit in the dark without a question, but....

Andrew
0
 
REA_ANDREWCommented:
you might aswell expose the question to everyone in here as you will have a better chance of getting an answer. :-)
0
 
rmmarshAuthor Commented:
Ahhh... the question resulted from another question regarding internationalization of dates.  Ken suggested I use the format "yyyy mm dd" and I indicated that the SQL statement barfed on the resulting date of '2007 32 22'...
I have successfully used "dd MMM yyyy", but he suggests that it is not bullet proof for all countries, which I agree; but when I convert current date to a string using the format "yyyy mm dd" it returns '2007 32 22' which SQL says is invalid (Duh!)
0
 
Bob LearnedCommented:
yyyy mm dd = Year Minutes Day
yyyy MM dd = Year Month Day

Bob
0
 
Computer101Commented:
PAQed with points refunded (500)

Computer101
EE Admin
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now