Click here to Skip to main content
14,239,593 members
   

ASP.NET

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder12-Jul-09 22:39
adminChris Maunder12-Jul-09 22:39 
PinnedHow to get an answer to your question Pin
Chris Maunder10-Nov-05 16:29
adminChris Maunder10-Nov-05 16:29 
QuestionForm Designer Pin
wrightyrx715-Jul-19 4:58
memberwrightyrx715-Jul-19 4:58 
AnswerRe: Form Designer Pin
Mycroft Holmes15-Jul-19 11:26
memberMycroft Holmes15-Jul-19 11:26 
GeneralRe: Form Designer Pin
wrightyrx715-Jul-19 11:33
memberwrightyrx715-Jul-19 11:33 
GeneralRe: Form Designer Pin
Mycroft Holmes15-Jul-19 14:08
memberMycroft Holmes15-Jul-19 14:08 
QuestionGetting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Abdalla Ben Omran11-Jul-19 9:29
memberAbdalla Ben Omran11-Jul-19 9:29 
AnswerRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Vincent Maverick Durano11-Jul-19 10:12
mveVincent Maverick Durano11-Jul-19 10:12 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Abdalla Ben Omran12-Jul-19 5:12
memberAbdalla Ben Omran12-Jul-19 5:12 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Vincent Maverick Durano12-Jul-19 12:01
mveVincent Maverick Durano12-Jul-19 12:01 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Abdalla Ben Omran13-Jul-19 0:31
memberAbdalla Ben Omran13-Jul-19 0:31 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Vincent Maverick Durano16-Jul-19 9:01
mveVincent Maverick Durano16-Jul-19 9:01 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Abdalla Ben Omran17-Jul-19 3:26
memberAbdalla Ben Omran17-Jul-19 3:26 
GeneralRe: Getting undefined in Cascading DropDownList In ASP.Core MVC ? Pin
Vincent Maverick Durano3hrs 36mins ago
mveVincent Maverick Durano3hrs 36mins ago 
QuestionA Potentially Dangerous Request.form Value Was Detected From The Client Pin
Member 1451693730-Jun-19 19:32
memberMember 1451693730-Jun-19 19:32 
AnswerRe: A Potentially Dangerous Request.form Value Was Detected From The Client Pin
F-ES Sitecore30-Jun-19 22:01
mveF-ES Sitecore30-Jun-19 22:01 
GeneralRe: A Potentially Dangerous Request.form Value Was Detected From The Client Pin
Member 1451693730-Jun-19 22:50
memberMember 1451693730-Jun-19 22:50 
GeneralMessage Closed Pin
2-Jul-19 20:49
professionalDds Detective2-Jul-19 20:49 
QuestionHow to read app config in a class library? Pin
Cenk KIZILDAĞ28-Jun-19 4:37
memberCenk KIZILDAĞ28-Jun-19 4:37 
AnswerRe: How to read app config in a class library? Pin
F-ES Sitecore28-Jun-19 4:50
mveF-ES Sitecore28-Jun-19 4:50 
QuestionI am having issues with getting results using dates as parameters Pin
samflex26-Jun-19 3:38
membersamflex26-Jun-19 3:38 
Greetings again,

I am still having some issues with this project.

This time, the issue is with pulling records by passing date values.

Everything else seems to work well.

We have two date parameters, date_start and date_end

A user can enter just value for start date only, end date only or date range between start date and end date.

The issue is that if a user enters start date, and clicks search, we get No data found message.

If user enters either value for end date or date range between start date and end date, the system hangs.

On the DB, using SSMS, if I enter a value for start date, I get results.

Similarly, if I enter value for either end date or date range between start date and end date, I get results very quickly.

When I put a debugger on my asp.net code, it returns the exact same value as the value I get when I run it from SSMS.

For instance,

Here is a value for start and end dates:

start date: 2014-05-05 10:34:03
end date: 2014-05-05 10:35:52

These values are the same when I query from the DB and as well as when I put debugger on my code.

The data type for these dates is DateTime2(0).

Any ideas why this is not working from my app?

Here are some code snips:

'//stored proc WHERE clause
WHERE 1 = 1
 AND ((@uuid IS NULL OR qp.uuid Like '%' + @uuid + '%')
 AND (@callerlist IS NULL OR  qp.call_list_id Like '%' + @callerlist + '%')
 AND (@phone IS NULL OR cl.phone_number Like '%' + @phone + '%')
 AND (@start IS NULL OR startttime >= @start)
 AND (@Endd IS NULL OR endtime <= @Endd)
 AND (@calltype IS NULL OR c.id Like '%' + @calltype + '%')
 AND cl.phone_number IS NOT NULL)


'/
<asp:TextBox id="date_start" style="width:150px;" class="form-control alignleft" runat="server" />

<asp:TextBox id="date_end" style="width:150px;" class="form-control alignleft" runat="server" />


'/VB:
Private Sub SearchCustomers()
     Dim constr As String = ConfigurationManager.ConnectionStrings("ppmtest").ConnectionString

     Using con As New SqlConnection(constr)

         Using cmd As New SqlCommand()

             Dim sql As String = "spGetLogs"
             cmd.CommandType = CommandType.StoredProcedure
             cmd.Parameters.AddWithValue("@uuid", suuid.Text)
             cmd.Parameters.AddWithValue("@callerlist", caller_list_id.Text)
             cmd.Parameters.AddWithValue("@phone", phonenumber.Text)
             cmd.Parameters.AddWithValue("@start", date_start.Text)
             cmd.Parameters.AddWithValue("@Endd", date_end.Text)
             cmd.Parameters.AddWithValue("@calltype", call_type.SelectedValue)
             'Response.Write(sql)
             'Response.End()
             cmd.CommandText = sql

             cmd.Connection = con
             Using sda As New SqlDataAdapter(cmd)
                 Dim dt As New DataTable()
                 sda.Fill(dt)
                 gvCustomers.DataSource = dt
                 gvCustomers.DataBind()

             End Using
         End Using
     End Using
 End Sub


As usual, any help is greatly appreciated
QuestionRe: I am having issues with getting results using dates as parameters Pin
Richard MacCutchan26-Jun-19 6:51
protectorRichard MacCutchan26-Jun-19 6:51 
AnswerRe: I am having issues with getting results using dates as parameters Pin
samflex26-Jun-19 7:12
membersamflex26-Jun-19 7:12 
GeneralRe: I am having issues with getting results using dates as parameters Pin
Richard MacCutchan26-Jun-19 7:27
protectorRichard MacCutchan26-Jun-19 7:27 
GeneralRe: I am having issues with getting results using dates as parameters Pin
samflex26-Jun-19 7:41
membersamflex26-Jun-19 7:41 

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.