Click here to Skip to main content
15,907,687 members
Home / Discussions / C#
   

C#

 
AnswerRe: usb dongle software for c# Pin
Marco Bertschi6-Feb-14 22:58
protectorMarco Bertschi6-Feb-14 22:58 
QuestionViewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
Mohan Subramani6-Feb-14 22:15
Mohan Subramani6-Feb-14 22:15 
AnswerRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
OriginalGriff6-Feb-14 22:19
mveOriginalGriff6-Feb-14 22:19 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
Shameel6-Feb-14 23:43
professionalShameel6-Feb-14 23:43 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
OriginalGriff6-Feb-14 23:55
mveOriginalGriff6-Feb-14 23:55 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
Shameel7-Feb-14 0:07
professionalShameel7-Feb-14 0:07 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
Mohan Subramani7-Feb-14 2:32
Mohan Subramani7-Feb-14 2:32 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
OriginalGriff7-Feb-14 2:42
mveOriginalGriff7-Feb-14 2:42 
Just pass the DateTime values as parameters to SQL. If you use DateTimePickers, there is no conversion needed:
C#
using (SqlConnection con = new SqlConnection(strConnect))
    {
    con.Open();
    using (SqlCommand cmd = new SqlCommand("SELECT iD, description FROM myTable WHERE enterDate BETWEEN @FD AND @TD", con))
        {
        cmd.Parameters.AddWithValue("@FD", fromDatePicker.Value);
        cmd.Parameters.AddWithValue("@TD", toDatePicker.Value);
        using (SqlDataReader reader = cmd.ExecuteReader())
            {
            while (reader.Read())
                {
                int id = (int) reader["iD"];
                string desc = (string) reader["description"];
                Console.WriteLine("ID: {0}\n    {1}", iD, desc);
                }
            }
        }
    }

Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)

GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
Mohan Subramani7-Feb-14 2:58
Mohan Subramani7-Feb-14 2:58 
GeneralRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
OriginalGriff7-Feb-14 3:23
mveOriginalGriff7-Feb-14 3:23 
AnswerRe: Viewing the data enterd in the SQL Server Database for a specifed Time frame. Pin
KeyStrokes7-Feb-14 2:21
KeyStrokes7-Feb-14 2:21 
QuestionHow to run Import-PSSessions (powershell command) from .C# program Pin
Eviatar Gerzi6-Feb-14 7:51
Eviatar Gerzi6-Feb-14 7:51 
AnswerRe: How to run Import-PSSessions (powershell command) from .C# program Pin
Eviatar Gerzi11-Feb-14 8:44
Eviatar Gerzi11-Feb-14 8:44 
QuestionRegEx problem #2 [solved] Pin
Marco Bertschi6-Feb-14 2:32
protectorMarco Bertschi6-Feb-14 2:32 
AnswerRe: RegEx problem #2 Pin
OriginalGriff6-Feb-14 2:54
mveOriginalGriff6-Feb-14 2:54 
GeneralRe: RegEx problem #2 Pin
Marco Bertschi6-Feb-14 3:00
protectorMarco Bertschi6-Feb-14 3:00 
GeneralRe: RegEx problem #2 Pin
OriginalGriff6-Feb-14 3:11
mveOriginalGriff6-Feb-14 3:11 
GeneralRe: RegEx problem #2 Pin
Marco Bertschi6-Feb-14 3:13
protectorMarco Bertschi6-Feb-14 3:13 
GeneralRe: RegEx problem #2 Pin
Ravi Bhavnani6-Feb-14 6:54
professionalRavi Bhavnani6-Feb-14 6:54 
GeneralRe: RegEx problem #2 Pin
Marco Bertschi6-Feb-14 8:59
protectorMarco Bertschi6-Feb-14 8:59 
AnswerRe: RegEx problem #2 Pin
Kornfeld Eliyahu Peter6-Feb-14 3:19
professionalKornfeld Eliyahu Peter6-Feb-14 3:19 
GeneralRe: RegEx problem #2 Pin
Marco Bertschi6-Feb-14 3:28
protectorMarco Bertschi6-Feb-14 3:28 
AnswerMessage Closed Pin
6-Feb-14 3:26
professionalPeter Leow6-Feb-14 3:26 
GeneralRe: RegEx problem #2 Pin
Marco Bertschi6-Feb-14 3:28
protectorMarco Bertschi6-Feb-14 3:28 
AnswerRe: RegEx problem #2 [solved] Pin
Nicholas Marty6-Feb-14 4:01
professionalNicholas Marty6-Feb-14 4:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.