Windows Phone Developers

Saturday, October 11, 2008

Solution : The type or namespace name 'Date' could not be found (are you missing a using directive or an assembly reference?)

Solution : The type or namespace name 'Date' could not be found (are you missing a using directive or an assembly reference?)

Error Codes:

< msxsl:script implements-prefix="vbadud" language ="C#" >

< ![CDATA[

public string Defaulted(Date RetDate)

{

return "Defaulted";

}

]] >

< /msxsl:script >

Solution: The type or namespace name 'datetime' could not be found (are you missing a using directive or an assembly reference?)

Error Code :

< msxsl:script implements-prefix="vbadud" language ="C#" >

< ![CDATA[

public string Defaulted(datetime RetDate)

{

return "Defaulted";

}

]] >

< /msxsl:script >

Use DateTime instead of Date or datetime in C#

Corrected Code

< msxsl:script implements-prefix="vbadud" language ="C#" >

< ![CDATA[

public string Defaulted(DateTime RetDate)

{

return "Defaulted";

}

]] >

< /msxsl:script >



Name Space Date Time Error Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

4 comments:

  1. Here is the solution. Hover your mouse in the word Date or DateTime and right click and pick "System".
    It will tell the Visual Studio compiler to grab it from the System class. Then try to rebuilt Ctrl+Shift+B. No more error or warning for that one.

    Cheers,
    Ronald Pringadi

    ReplyDelete
    Replies
    1. Worked well in VS2008

      Delete
  2. Tghanks Ronald Pringadi. It works a marvel

    ReplyDelete
  3. sorry it does work on visual studio 2010.. please help!

    ReplyDelete

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005