How do I compare two DateTime objects?
View Complete Post
i have got two list<string> containing datas
i would like to compare the both list and the result to new list whch does not contains the same data.(basically unique data)
eg shown below..
list A list b list c
a a d
b d c
c f e
plz let me knw..
I'd like to have the date and time from server.
DateTime.Now Is ok?
Must be something else?
I have an objuct that I declared like this:
Class DailyStats Dim _day As String Dim _hour As String Dim _impressions As String Dim _clicks As String Property Day() As String Get Return _day End Get Set(ByVal value As String) _day = value End Set End Property Property Hour() As String Get Return _hour
What is the proper way to check for null or empty strings on dynamic objects? This is the only solution I've found so far:
if (admin.PasswordHash.GetType() == typeof(DBNull) || admin.PasswordHash == string.Empty)
If the field is null, the object returned is DBNull.Value, but if the field is empty string, it's return as a System.String object. This makes it impossible to do regular "admin.PasswordHash == DBNull.Value" check, as that will fail whenever the field has been set to empty string. Is my example the right (and only) way to go?
Is there any way or process to serialize the the objects?? i am trying to store the instance of few control in viewstate but it shows error msg that it is not a serialized object. should i perform some steps to serialize the objects ???
I'm getting the following error:
[ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value]
System.DateTime.Add(Double value, Int32 scale) +7657639
System.DateTime.AddDays(Double value) +19
The line from which this error originates has the following code:
expires = Now.AddDays(30)
It occurs irregularly and irreproducably. The server date/time is correct and set to GMT. I've heard that it could be some curiosity to do with timezones, but that is speculative.
It seems that we're some time from the year 10,000 yet, so I can't understand why adding thirty days to the current time could cause this! Any ideas? Culture settings perhaps?
1 Partial Class _Default2 Inherits System.Web.UI.Page
3 Public Function Ohjoy(ByVal X As Integer) As Integer4 Dim theClass As New Class1 '= New Class1()5 theClass.ReSize(0)6 theClass.myBaby(0).GetName(0) = "Hello" 'Property Chars is read only'7 Return 18 End FunctionI have a first class named "Class1". I have a second class named "Class2" Class2, is a member of class 1,and is implemented as an array of objects of type Class 2.
If I try and call the Accessor GetName() my hard coded value "Hello" in my accessor is not returned? Onlyan alpha character like "T"
Also if I try and assigne a value using the setter GetName() it does not work, and the compiler gives me an error message "property Chars is ReadOnly? Does anyone know what is wrong in my code? Line 6 above
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Ohjoy(1)End SubEnd Class
Public Class Class1 Dim bs As Integer Public myBaby() As Class2 Public myB As Class2 Public Function ReSize(By
The .NET Framework 4 introduces some new features that enable you to go beyond static types. We explore dynamically expando objects and demonstrate how they can be used like dynamically updatable dictionary objects.
MSDN Magazine July 2010
After a brief refresher on procedural and object based patterns for organizing the business logic layer, the author focuses on data transfer objects and the impact they have on the development of the software project.
MSDN Magazine August 2009
Use Test-Driven Development with mock objects to design object oriented code in terms of roles and responsibilities, not categorization of objects into class hierarchies.
MSDN Magazine June 2009
Reflection is useful for debugging and logging and otherwise providing the type information you need. Here you'll see how to use reflection on COM types.
MSDN Magazine January 2009
Serialize and Deserialize Fixed Length and Delimited Files, Scott Allen's blog, inspecting Web Pages, and more.
MSDN Magazine August 2008
This month test your web site on many platforms and browsers without setting up a test environment, use mock objects for unit testing, and visit Raymond Chen.
MSDN Magazine June 2008
SQL Server Management Objects offer developers a robust toolset for backing up and restoring databases, and issuing DDL commands, as John Papa explains.
MSDN Magazine June 2007
In this column see how to bind a custom list of business entities using the binding tools in the .NET Framework 2.0.
MSDN Magazine February 2007