Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

For Ken Haley

Posted on 2007-07-23
7
Medium Priority
?
207 Views
Last Modified: 2010-04-15
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
Comment
Question by:rmmarsh
5 Comments
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 19550618
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
 
LVL 20

Expert Comment

by:REA_ANDREW
ID: 19550621
you might aswell expose the question to everyone in here as you will have a better chance of getting an answer. :-)
0
 

Author Comment

by:rmmarsh
ID: 19550663
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
 
LVL 96

Expert Comment

by:Bob Learned
ID: 19742661
yyyy mm dd = Year Minutes Day
yyyy MM dd = Year Month Day

Bob
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 19995449
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview

572 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question