Fórmulas e Cenas

Object Reference Not Set to an Instance of an Object

  Home  |   Contact  |   Syndication    |   Login
  45 Posts | 0 Stories | 14 Comments | 0 Trackbacks

News

Archives

Post Categories

Links

March 2010 Entries

Well... I cant really express my feelings for this kind of programming...

The WTF way:

DateTime myNewDate = DateTime.Parse((myOldDate.Year - 1).ToString() + "-" + myOldDate.Month.ToString() + "-" + myOldDate.Day.ToString());

 

The right way:

 DateTime myNewDate = myOldDate.Date.AddYears(-1);

 


Well, this one i simply cannot understand... why anyone would do +0 after and int.parse. Any Ideas?

int myVar = Int32.Parse(ConfigurationManager.AppSettings["mySetting"] + "") + 0;

 


        protected override void OnPreInit(EventArgs e)
        {
            Page.MasterPageFile = "~/LinkToMasterPage";
            base.OnInit(e);
        }

 

Enjoy :)


DBCC CHECKIDENT (yourtable, reseed, 0) Enjoy :) ......

It's a tricky and annoying situation...

To do work around it, execute the following command on command prompt:

netsh winsock reset

Then Restart Windows enter the next command:

netsh int ip reset reset.log

Restart Windows and you are ready to go.


Enjoy :)