.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

please solve my error ...in DateTime

Posted By:      Posted Date: September 27, 2010    Points: 0   Category :ASP.Net

Dear Members

               Please See the Following Code

DateTime startDate = new DateTime(); // 01/01/0001 is the default date.

            DateTime endDate = new DateTime(); // 01/01/0001 is the defaut date.


            if (!string.IsNullOrEmpty(textBoxStartDate.Text.Trim()) &&



                DateTime.TryParse(textBoxStartDate.Text.Trim(), out startDate);

                DateTime.TryParse(textBoxEndDate.Text.Trim(), out endDate);


I have given some date in both (textBoxStartDate and textBoxStartEndDate).

But while the Debugging, i found that  startDate and endDate doesn't takes the values from both texboxes....(it always shows /takes the default date(1/1/0001)..

Please find out my error..


DateTime startDate = new DateTime(); // 01/01/0001 is the default date.

View Complete Post

More Related Resource Links

How can I solve this problem?::Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.Cryst


I upgraded my web application from visual studio 2003 to 2008. When I want to create a report in visual studio 2008 and receiving this error at runtime. I am able to compile but when runnning thats when I am getting this error.

How can I solve this problem? please help.

Compilation Error

Server Error in '/IRPSDEV' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0433: The type 'CrystalDecisions.Web.CrystalReportViewer' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\CrystalDecisions.Web\10.5.3700.0__692fbea5521e1304\CrystalDecisions.Web.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\irpsdev\9e97e0a9\94a2ecd\assembly\dl3\151eb571\00df56e1_6064c201\CrystalDecisions.Web.DLL'

Source Error:

Line 161:        
Line 162:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 163:        private global::CrystalDecisions.Web.CrystalR

Please solve this error..

Server Error in '/Study' Application. -------------------------------------------------------------------------------- Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index  int j=0; foreach (GridViewRow row in GridViewTest.Rows)         {             CheckBox cb = (CheckBox)row.FindControl("checkboxItems");              arrayCheckbox[j] = GridViewTest.Rows[j].FindControl("LabelEmpname");               j++;        } Server Error in '/Study' Application.--------------------------------------------------------------------------------Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index int j=0; foreach (GridViewRow row in GridViewTest.Rows) { CheckBox cb = (CheckBox)row.FindControl("checkboxItems"); arrayCheckbox[j] = GridViewTest.Rows[j].FindControl("LabelEmpname"); j++; } Hello friends please solve my error..

"Out-of-Range" Error When Passing DateTime (DD/MM/YYYY) into Stored Procedure

Hi everybody, I hope some of you will be able to help me regarding this datetime problem. The query in the stored procedure doesn't accept DD/MM/YYYY format, although all dates are being saved in the format of DD/MM/YYYY hh:mm:ss. Example of query that throws the error: @sDate = '31/8/2010' @eDate = '1/9/2010' SELECT * FROM tb_Schedule where scheduledate >= @sDate and scheduledate <= @eDate  Error:  The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value FYI, the SQL Server 2005 is defaulted to British English(2057)for all logins and the DB server itself and my server Regional and Language is set to English (United Kingdom). Any help will be appreciated. Thank you very much.  

How to solve this "Smtp: Mailbox Unavailable or not local " error ?

I am trying to send Email to the Email Addresses stored in the Database, some are working fine but I am getting stuck when I get hit with this error.. The server rejected one or more recipient addresses. The server response was: 550 Requested action not taken: mailbox unavailable or not local I think this is something to do with SMTP Virtual Server Settings in IIS but i dont know what actually i should change over there. The code in the ASP.NET page worked for 40-50 mail addresses but suddenly i am getting this error Can anyone help please. Any ideas will be of great help to me .. Thanks in Advance

Flat file upload: Error when inserting into datetime field.

Hi All I am having an issue with uploading a txt file into an SQL table and one of the fields needs to go into a datetime column. The issue is with column3 I have been into the advanced editor of the flat file source and set the output column to decimal and it fails. The error I am getting is below: Error: 0xC02020A1 at Materials Transfer, Flat File Source [1]: Data conversion failed. The data conversion for column "Column 3" returned status value 2 and status text "The value could not be converted because of a potential loss of data.". Error: 0xC0209029 at Materials Transfer, Flat File Source [1]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.  The "output column "Column 3" (48)" failed because error code 0xC0209084 occurred, and the error row disposition on "output column "Column 3" (48)" specifies failure on error. An error occurred on the specified object of the specified component.  There may be error messages posted before this with more information about the failure. Error: 0xC0202092 at Materials Transfer, Flat File Source [1]: An error occurred while processing file "D:\Development\r3_downloads\mat.txt" on data row 1. Any help would be great.   Thanks BigGopher

Help to resolve an error "The conversion of a char data type to a datetime data type resulted in an

Why am I getting an error when executing this: select convert(datetime, '2010-09-12T18:11:48', 120) The message is: "Msg 242, Level 16, State 3, Line 1 The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value." I don’t get the error if I remove “T” from the string. But I need it to work with “T”.

Error converting data type nvarchar to datetime.

hi all, I simply explain my application.plz try to understand. In my applicationi want to generate one complaint id.one customer may give two or more complaints at a time.suppose,he give two or more pnr numbers and their status and prioirty may differs.for this complaint i need to generate one common complaint id.how it is possible..?with some constant rows. am getting error in Class File near CLUser_Logged_DTClass File using System; using System.Data; using System.Configuration; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Data.SqlClient; using System.Web.Configuration; /// <summary> /// Summary description for BalComplaints /// </summary> public class BalComplaints { public BalComplaints() { // // TODO: Add constructor logic here // } int SNo, Complaint_Type_ID, Caller_Type_ID, No_of_Articles, Article_ID, CLPriority_ID, Status_ID, Origin_ID, Destination_ID; public int SNo1 { get { return SNo; } set { SNo = value; } } public int Caller_Type_ID1 { get { return Caller_Type_ID; } set { Caller_Type_ID = value; } } public int Destination_ID1 { get { return Destination_ID; } set { Destination

Can not solve this html error .

Hello everybody. i am trying to make my web site 0 html error at http://validator.w3.org for better seo but i have 2 html error atm and can not solve it could you please help me thank you   error results   http://validator.w3.org/check?uri=http://www.pokemoncraft.com/Pokedex&charset=(detect+automatically)&doctype=Inline&group=0   the code causes error  <div id="PokeNationIdTitleSort_Tr" style=" position:absolute; left:0px; text-align:center; width:48px; height:12px; line-height:12px; overflow:hidden; top:34px;"> <asp:ImageButton ID="btnSiralaPokeNationNo_Tr" onclick="SiralamaDegistirPokeNationNo" runat="server" /> </div> <div id="Loader" style=" position:absolute; top:64px; left:800px; overflow:hidden; width:64px; height:64px;"> <asp:UpdateProgress ID="UpdateProgress1" runat="server"> <ProgressTemplate > <% if (srLang == "en") { %> <asp:Image ImageUrl="~/images/gamepageimages/GamePageLoader_en.gif" ID="imgAjaxLoader" ToolTip="Waiting Server To Respond" runat="server" /> <%} %> <% if (srLang == "tr") { %>

How to solve this error This form template is not currently browser enabled?



I would like my form be browser enabled. Users wont use InfoPath to fill it.

Enviroment: Sharepoint2010, form was created in Infopath2010 

InfoPath form properties:

  Security and Trust: Automatically dtermine security level

  Compatibilyty Form type: Web Browser Form

The form was published as a content type to my site. I checked my form for browser compatibility - it was ok.

In my Form library 

   Allow managment content type = Yes

   Opening Document in the Browser = Open in Browser

The features Enterprise feature are enabled on site collection feature and site feature.


But it is still impossible to view my form in browser. The error is appeared: This form template is not currently browser enabled.

Who knows what is wrong? How to make my form web browsable?






DateTime conversion Error

I am getting the following error while executing a SSIS package.
[OLE DB Destination [760]] Error: There was an error with input column "RecordEffectiveDate" (828) on input "OLE DB Destination Input" (773).
 The column status returned was: "Conversion failed because the data value overflowed the specified type.".


Source is a non sql server with datetime datatype and the data like 10/20/2004 2:23:27 PM
and the sql server destination datatype is datetime.


c# DateTime error.


I have a function like

        public void Test(DateTime time)
            DateTime date = time.Date;

            Debug.Assert(date >new DateTime());


I run this function too many times with no problem. however sometimes I get exceptions in line "Debug.Assert(date >new DateTime());".

I checked, and the variable "date" has been assigned to year=1,month=1, and day =1. And the variable "time" is definitely larger than "new DateTime()"

Is it a .net framework bug? I'm using DotNet 2.0


Database Tuning Advisor, Stored Procedure with datetime parameters, syntax error


I receive these error(s) in the Tuning Log. I have several stored procedures and they all use a datetime parameter.

E000    exec <some sproc name> ''2009-01-01 00:00:00:000'',''2010-09-30 00:00:00:000'',N'',N'',NULL,NULL,NULL,NULL,NULL,NULL         1    [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '2009'.

I am using SQL 2005. Any suggestions?

Thanks, Reece

System.Data.SqlClient.SqlException: Error converting data type nvarchar to datetime.


 Hi All,

I have recently moved a ASP.NET webserver from windows XP to
windows server 2008.
The website runs fine apart from anywhere that pulls a date
or uses the date from a JS date picker etc.

The error I am receiving is:

System.Data.SqlClient.SqlException: Error converting data type nvarchar to datetime.

Source Error:

Line 79:         cmd1.Parameters.AddWithValue("@EndDate", lblSearch2.Text);
Line 80:         conn.Open();
Line 81:         SqlDataReader reader = cmd1.ExecuteReader();
Line 82:         if (reader.HasRows)
Line 83:         {

Source File: c:\inetpub\wwwroot\folderx\pagex.aspx.cs    Line: 81

Stack Trace:

[SqlException (0x80131904): Error converting data type nvarchar to datetime.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +1951450
   System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +4849003
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject s

Couldnot solve this Unknown Build Error


I am trying to run the project that was developed in another system under Visual Studio 2010. It is running without any error on that System, but when i tried to run it on my System it continuously generates the following error and the build process always fails.

Unknown build error, 'Could not load type 'System.Runtime.Versioning.TargetFrameworkAttribute' from assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089'.'

Can anyone help me to solve this error.


Saugat K.C.

SQL Execution Error, Specified type is not registered on the target, when adding DateTime parameters


I have SQLServer 2008r2 installed on a Windows Server 2008 R2 machine.  I'm trying to build a report using SSRS - and as soon as I try to add some DateTime parameters to the query and execute, I get

SQL Execution Error.

Executed SQL Statement:  blah blah Error

Source: System.Data

Error Message: Specified type is not registered on the target server.System.DateTime, mscorlig, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089.

I tried taking the suggestion from another thread and installing the .NET Framework 2.0 from: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=B44A0000-ACF8-4FA1-AFFB-40E78D788B00, but I received the message that it is already installed.  How do I get past this error?

how to solve "Cannot complete this action." error on Require documents to be checked out with https


In our SharePoint environment, when the user try to change "Require documents to be checked out before they can be edited?" to Yes in "Document Library Versioning Settings" screen in Default mode, it works fine. But if the user do the same action in "Internet" mode which we configured as "https", it throws the error like "Cannot complete this action. Please try again."

Could anyone please let me know about how to resolve this issue?

www.aristonsoft.com - .net 3.5 hosting provider in India

How to solve Application error at the time of starting debugger

Hello all,

This is my first post here. So if I posted in wrong forum point me to the correct direction.

I have installed Visual Studio 2005 (.Net 2.0) in my Windows Xp Service Pack 2 operating system.
When the setup had finished the wizard displayed me the following message :-

Visual Studio Setup is complete.
Setup is completed with some warnings."

Now when I clicked the "View Error Log" link a web document opened and there I found so many lines. Of them one is :-

"Failed to copy the file properly Webdev.Webserver.Exe"

Now when I'm trying to launch Vs2005 IDE, it is working but when I'm trying to run my programs by pressing F5 or anyone of the available debugger options I'm fetching the following errors :-

In case of windows applications (regradless whether the selected language is VB or C#) :-
"The application failed to initiliaze properly (0xc000007b). Click on OK to terminate the application."

In case of web a
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend