Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Hi I finally solved it.</p> <p>How I tracked it?<br> Enabling script debugging and used fiddler 2 tool and found whats going wrong. I found some error was thrown at date parsing.</p> <p>What I did to solve? I wrote a method for datetime conversion as </p> <pre><code>public static bool ValidateDate(string txtDate, string sDateFormat, ref string sErrMsg, ref DateTime dtDate) { if (txtDate == "") { sErrMsg = "Please Enter Date"; return false; } else { System.Globalization.DateTimeFormatInfo dateInfo = new System.Globalization.DateTimeFormatInfo(); dateInfo.ShortDatePattern = sDateFormat; try { dtDate = Convert.ToDateTime(txtDate, dateInfo); return true; } catch { sErrMsg = "Please Enter Date In Correct Format"; return false; } } } </code></pre> <p>then I used as </p> <pre><code>string errMsg = string.Empty; Boolean IsFromDateValid = false; DateTime fromDate = new DateTime(); IsFromDateValid = ValidateDate(wdpfrom.Text.Trim(), "dd/MM/yyyy", ref errMsg, ref fromDate); if (IsFromDateValid == false) { ShowMessage(errMsg); return; } Boolean IsToDateValid = false; DateTime toDate = new DateTime(); IsToDateValid = ValidateDate(wdpTo.Text.Trim(), "dd/MM/yyyy", ref errMsg, ref toDate); if (IsToDateValid == false) { ShowMessage(errMsg); return; } else { TimeSpan ts = new TimeSpan(23, 59, 59); toDate = toDate.Add(ts); } </code></pre> <p>and finally passed parameter to SP as </p> <pre><code> cmdGetPost.Parameters.AddWithValue("@dateFrom", fromDate); cmdGetPost.Parameters.AddWithValue("@dateTo", toDate); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload