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

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

save time in seconds in datetimepicker...

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :Windows Application
Hi..i am working on winforms.My doubt is that i want datetimepicker to save time..For ex. if i have set the time to 10secs and i have closed the form.again when i open the form it should show me the same value.Is it possible in datetimepicker?Do Reply..
Thanks & Regards Nazima Mahmood

View Complete Post

More Related Resource Links

Toolbox: Save Coding Time, Manage Compressed Files, and More


Save Coding Time, Manage Compressed Files, and More

Scott Mitchell

MSDN Magazine January 2007

Unit Testing Tips: Write Maintainable Unit Tests That Will Save You Time And Tears


Everybody's talking about unit testing and you want to get into the game too. But you don't want the tests to take up all your development time and energy. Fortunately Roy Osherove is here to dispel some testing myths and put you on the road to efficient unit testing.

Roy Osherove

MSDN Magazine January 2006

can anyone tell me why setInterval is not working properly i want to display the time every seconds,

setInterval is suppose to execute the script every second there getting the most uptodate time of day , but it does not update it stays the same
      <script type="text/JavaScript">

          function interval() {
              setInterval("time()", 1000);
          function time() 
              var d = new Date();
              var time = d.getHours();
              var time2 = d.getMinutes();
              var time3 = d.getSeconds();

              document.write(" : ");
              document.write(" : ");
  // -->
      <input type="button" OnClick="interval()" value="Click Me!"/>


Query execution time from 1 second in SQL 2000 to 20 Seconds in SQL 2008 R2


When I ran this query from SQL 2000 it takes 1 second. now in SQL 2008 R2  the same query is 20 times slower.

This is the query and the numer of records and the time in SQL 2008 R2:

SELECT * FROM dbo.CxP_Saldos 
0 seconds, 923 Rows
SELECT * FROM S_Conta.Cuentas
0 seconds, 662 Rows
SELECT * FROM S_Conta.Cuentas c INNER JOIN dbo.CxP_Saldos s ON c.id = s.CtaProv
18 seconds, 923 Rows

how can I submit the actual execution Plan?

ASP.NET session variables, do you need to save each time?


Anytime you change the object variable that is already assigned to a session variable, do you need to "re-save" the variable back into the session variable or does it do it automatically?

For example:

// abc is an object of some random type

Session["abc"] = abc;  // initial declaration of session variable.

abc.a=1;  // updated abc.a field after a button_click event

Session["abc"] = abc;   // resave the new field value of 'a' back into the session variable 'abc'.

Or does the session variable already keep track of all changes made to the object and saves automatically?


Best time to save "structure" session variable


I have a structure that groups a number of fields together that I want to use to retain values between different web pages. My plan was to transfer the structure to a session variable and retrieve it as each page loads. In theory each of the different fields could be stored in and retrieved from separate session variables but the structure approach seemed more elegant.

I was initially assuming I would be a "sensible time" (e.g. specific event) when I could consistently save the structure content to the session variable but I realise that I may be on the wrong track and that it may be necessary to transfer to the session variable to the structure each time one of the individual field values is updated as there is no way of determining when the user is about to move to another page.

Is there a solution to this or a better approach?

threading timers fires few seconds before the actual due time



We're getting following problem while using system.threading.timer ( .net framework 2.0 ) from a Windows service.

There are around 12 different timer objects..
Each timer has due time and interval. This is set correctly.
It is observed that after 3 to 4 hours, the timers start signalling before their interval elapses. For example if the timer is supposed to signal at 4:59:59, it gets signalled at 4:59:52, 7 seconds earlier.
Can someone tell me what is the cause for this behavior and what is the solution for that ?

Thanks, Gayatri

Getting the IP address of each time the user has logged in and save it in profile ....


Hello there ..


I have profile variable called IP Address ,

i need this Profile to add Unique IP address that has been used by the UserName ,,,

meaning :

If i logged in for the first time , it will save my IP address , next time if my IP has changed and i logged in , i need to keep the old IP address and add to it with comma seperated the new IP ..


Can you help me in that ... 

Remote insert speeds query time from 5.5 mins to 3 seconds?



I have a query running in SQL Server 2005 sp2 that takes just over 5½ minutes to run despite my best efforts to speed it up.

It is an INSERT INTO local table SELECT FROM sql statement.  If I just run the SELECT part, it still takes over 5½ minutes.  The query is currently returning 2 rows of data.

However, If I change the table it inserts into to be an identical table on a remote server using a linked server, then it runs in 3 seconds????

I like the time it now takes, but I do not understand why it is so much faster inserting into a table on a remote server.  If anything, I expected it to take a little longer - anyone have any ideas?

These are examples of the query:
--Takes approximately 05:26 to complete
SELECT Field1, Field2, Field3

Round off time to the nearest minute

How would you round this up to the nearest minute? There isn't a built in function to do this so you have to use a little bit of maths to get there. There are 60 seconds in a minute. We already have 38 seconds on the clock. So we need to add on 60 - 38 = 22 more seconds.

Performance Tests: Precise Run Time Measurements with System.Diagnostics.Stopwatch

Everybody who does performance optimization stumbles sooner or later over the Stopwatch class in the System.Diagnostics namespace. And everybody has noticed that the measurements of the same function on the same computer can differ 25% -30% in run time. This article shows how single threaded test programs must be designed to get an accuracy of 0.1% - 0.2% out of the Stopwatch class. With this accuracy, algorithms can be tested and compared.

Date and Time Functions in SQLSERVER

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

1 DATEPART Function
2 DATENAME Function
3 DAY, MONTH, and YEAR Functions
5 DATEADD Functions
6 DATEDIFF Function
7 More SQL Server Functions

Data Types - Date and Time in SqlServer

Date and time values can be stored with either the DATETIME or SMALLDATETIME data type. The difference between the two is that SMALLDATETIME supports a smaller range of dates and does not give the same level of precision when accounting for time. The DATETIME data type can hold values from January 1st of 1753 to December 31st of 9999. The time is stored to the 1 three hundredths of a second and each value takes up 8 bytes of storage. The SMALLDATETIME data type can hold values between January 1st 1900 and June 6th of 2079. The time is tracked to the minute and each value takes up 4 bytes of storage. The majority of business applications can live happily with SMALLDATETIME, however, if you are in an environment where each second matters or you need to make estimates to the distant future (or past) then you have to resort to DATETIME. If you fail to specify the time when inserting a value into a DATETIME or SMALLDATETIME column, a default of midnight is used. If you fail to specify the date portion the default of January 1, 1900 is used.

How to programmatically add controls to Windows forms at run time by using Visual C#

Create a Windows Forms Application
Start Visual Studio .NET or Visual Studio 2005 or a later version, and create a new Visual C# Windows Application project named WinControls. Form1 is added to the project by default.
Double-click Form1 to create and view the Form1_Load event procedure.
Add private instance variables to the Form1 class to work with common Windows controls. The Form1 class starts as follows:

.NET 4 Web Application Startup Time

I was chatting with Jonathan Hawkins and some of the folks on the ASP.NET team about performance and Jonathan mentioned the startup time for large ASP.NET applications is improved on .NET 4. There are some improvements in the CLR and in ASP.NET itself that helped. If you have a giant app, you should do some tests.

Built-in Functions - Date and Time Functions

Date and time functions allow you to manipulate columns and variables with DATETIME and SMALLDATETIME data types.

Essential SQL Server Date, Time and DateTime Functions

The essential date and time functions that every SQL Server database should have to ensure that you can easily manipulate dates and times without the need for any formatting considerations at all.
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