Click here to Skip to main content
15,883,796 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: I am having issues with getting results using dates as parameters Pin
samflex26-Jun-19 10:40
samflex26-Jun-19 10:40 
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard Deeming27-Jun-19 2:14
mveRichard Deeming27-Jun-19 2:14 
GeneralRe: I am having issues with getting results using dates as parameters Pin
samflex27-Jun-19 3:27
samflex27-Jun-19 3:27 
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard Deeming27-Jun-19 3:32
mveRichard Deeming27-Jun-19 3:32 
GeneralRe: I am having issues with getting results using dates as parameters Pin
samflex27-Jun-19 4:30
samflex27-Jun-19 4:30 
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard Deeming27-Jun-19 4:33
mveRichard Deeming27-Jun-19 4:33 
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard Deeming27-Jun-19 4:39
mveRichard Deeming27-Jun-19 4:39 
GeneralRe: I am having issues with getting results using dates as parameters Pin
samflex27-Jun-19 4:54
samflex27-Jun-19 4:54 
I have actually switched to DateTime.TryParse using this:

m startDate As DateTime
Dim EndDate As DateTime

If DateTime.TryParseExact(date_start.Text, "yyyy-MM-dd hh:mm:ss", New CultureInfo("en-US"), DateTimeStyles.None, startDate) Then
    cmd.Parameters.AddWithValue("@start", startDate)
Else
    cmd.Parameters.AddWithValue("@start", DBNull.Value)
End If
If DateTime.TryParseExact(date_end.Text, "yyyy-MM-dd hh:mm:ss", New CultureInfo("en-US"), DateTimeStyles.None, EndDate) Then
    cmd.Parameters.AddWithValue("@Endd", EndDate)
Else
    cmd.Parameters.AddWithValue("@Endd", DBNull.Value)
End If


I am going to your solution instead.

You might be right about having that many records in the DB but this is the part that confuses me.

I run this in SSMS:
select startttime, endtime from cti.qpcdr where startttime >= '2014-05-05 10:34:03' and endtime <= '2014-05-05 10:35:52'


It returns one record.

I enter one value to start date and the other value to end date textboxes and it returns No record found.

If a record had been returned, it would have given me the confidence I need to conclude that it works.
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard Deeming27-Jun-19 4:58
mveRichard Deeming27-Jun-19 4:58 
AnswerRe: I am having issues with getting results using dates as parameters Pin
ZurdoDev26-Jun-19 8:23
professionalZurdoDev26-Jun-19 8:23 
Questionopen word file in client side Pin
Member 1447396626-Jun-19 1:34
Member 1447396626-Jun-19 1:34 
AnswerRe: open word file in client side Pin
Richard MacCutchan26-Jun-19 1:44
mveRichard MacCutchan26-Jun-19 1:44 
GeneralRe: open word file in client side Pin
Member 1447396626-Jun-19 17:48
Member 1447396626-Jun-19 17:48 
GeneralRe: open word file in client side Pin
Richard MacCutchan26-Jun-19 21:14
mveRichard MacCutchan26-Jun-19 21:14 
QuestionSafe Storage of Secrets in .NET Pin
Ger Hayden24-Jun-19 21:58
Ger Hayden24-Jun-19 21:58 
AnswerRe: Safe Storage of Secrets in .NET Pin
Richard Deeming25-Jun-19 1:25
mveRichard Deeming25-Jun-19 1:25 
GeneralRe: Safe Storage of Secrets in .NET Pin
Ger Hayden25-Jun-19 6:55
Ger Hayden25-Jun-19 6:55 
AnswerRe: Safe Storage of Secrets in .NET Pin
Afzaal Ahmad Zeeshan25-Jun-19 23:46
professionalAfzaal Ahmad Zeeshan25-Jun-19 23:46 
GeneralRe: Safe Storage of Secrets in .NET Pin
Ger Hayden26-Jun-19 2:17
Ger Hayden26-Jun-19 2:17 
QuestionASP.NET web api tutorial Pin
AstroTheDog24-Jun-19 0:24
AstroTheDog24-Jun-19 0:24 
AnswerRe: ASP.NET web api tutorial Pin
Eddy Vluggen24-Jun-19 1:52
professionalEddy Vluggen24-Jun-19 1:52 
GeneralRe: ASP.NET web api tutorial Pin
AstroTheDog24-Jun-19 3:14
AstroTheDog24-Jun-19 3:14 
GeneralRe: ASP.NET web api tutorial Pin
Eddy Vluggen24-Jun-19 3:26
professionalEddy Vluggen24-Jun-19 3:26 
AnswerRe: ASP.NET web api tutorial Pin
Ger Hayden25-Jun-19 21:33
Ger Hayden25-Jun-19 21:33 
AnswerRe: ASP.NET web api tutorial Pin
Afzaal Ahmad Zeeshan25-Jun-19 23:50
professionalAfzaal Ahmad Zeeshan25-Jun-19 23:50 

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.