Categories: ASP.Net Posted by yeejie on 1/11/2010 8:27 AM | Comments (0)

A great post comparing the differences between ASP.Net MVC validation framework available out there: http://goneale.com/2009/06/25/aspnet-mvc-validation-refresh-best-techniques-frameworks/

As I tried, “devermind.com: Client-side form validation made easy (w/ xVal)” so far remains the best validation framework as it combines Data Annotation, jQuery and xVal methods together.

Posted by yeejie on 1/8/2010 4:30 PM | Comments (0)

Pasted from http://www.codetoday.net/default.aspx?g=posts&t=1595. Thanks to AdmOd.

1) In your IIS, identify your web site’s application pool as illustrated as below.

001(2)

2) Go to Application Pools under your IIS

002

3) Right-click the early identified Application Pool, select “Advanced Settings” to go to the menu as shown below. Change the “Build-in account” value to “LocalSystem”

003

Categories: ASP.Net Posted by yeejie on 1/8/2010 7:58 AM | Comments (0)

Pasted from http://weblogs.asp.net/hosamkamel/archive/2008/11/20/asp-net-mvc-project-and-team-build-issue.aspx. Original Author: Hosam Kamel

To get the MVC project build successfully with the team build make sure of the following:

- Your build server has the WebApplication targets file located in <Program Files> \MSBuild\Microsoft\Visual Studio\v9.0\WebApplications , if not . copy this file from your development machine to the same path in the build server.

- You have installed ASP.NET MVC framework in the Build server, this is the most important step otherwise you application will not build successfully in the team build you may faces some errors like :

error CS0234: The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)

or

Controllers\RuleController.cs(31,10): error CS0246: The type or namespace name 'AcceptVerbs' could not be found (are you missing a using directive or an assembly reference?)

** Update

This will work with Beta version of ASP.NET MVC since the installation register the MVC assembly in GAC.

For preview versions , you can reference the DLL from your build project

<AdditionalReferencePath Include="C:\Program Files\Microsoft ASP.NET\ASP.NET MVC CodePlex Preview 4\Assemblies" />

Categories: Win 7 Posted by yeejie on 11/7/2009 7:00 PM | Comments (0)

Pasted from http://www.enduserblog.com/2009/09/using-the-windows-7-problem-steps-recorder.html. Original article by Debra Shinder

One of the brand new features in Windows 7 is the Problem Steps Recorder, which is a very cool screen capture utility, the intended use of which is to allow computer users to do a step by step recording of the actions they take that result in a problem, rather than trying to verbally describe it to a tech support person. You may find other, more creative uses for it, as well. Here’s how it works:

To open the tool, click Start and type psr.exe. Click it in the list and the recorder bar opens, as shown below.

6a00e54ed05fc288330120a5b7a843970c

As you can see, the interface is compact and very simple, making it easy for even novice computer users to use. You simply click the Start Record button to beginning capturing what you’re doing on the computer. You can pause or stop the recording at any time.

At any point in the recording, you can click the Add Comment button and the recording will pause, and a text box will pop up where you can type in clarifications or questions you might have about that particular step, or information that’s not visible in a screen capture (such as the computer emitting a sound).

During the recording, the duration of the recording will be shown in the box on the right side of the window. Once you stop the recording, you’ll be prompted to give the recording a name and save it as a zipped file. When you open the .ZIP, you’ll see a file saved in .MHT format, which is a web page archive that can be viewed in Internet Explorer or another web browser, as shown at below.

6a00e54ed05fc288330120a5612e04970b

Double click the .MHT file, and it will open in your default web browser. You’ll see a series of screen shots, along with the time recorded and even a description of each action that you took during the recording, as shown below. Any comments you insert will be shown.

6a00e54ed05fc288330120a5612e33970b

As you can see, if you have multiple monitors, all of the screens will be shown in the capture. The area where you’re clicking with the mouse is highlighted in green.

This takes much of the frustration out of troubleshooting for both the user and the support tech. You don’t have to worry about the user leaving out steps or not being able to properly describe what he/she did. At the bottom of the page is an “Additional Details” box that contains information such as the version numbers of the programs, user interface elements that were in use during each step, and so forth.

If you click the Down arrow at the very right side of the PSR window, you’ll see options to run the tool as an administrator or to send the recording to an email recipient. You can also click Settings … to change the output location for the .ZIP files (by default, they’re saved to the desktop), to enable or disable screen capture (if you disable it, you will get the text description of the steps only, not the screenshots), and specify the number of recent screen captures to store (25 by default).

Troubleshooting isn’t the only use I’ve found for it. If you want to show someone else exactly how to do something in Windows 7, but you can’t use Remote Assistance, you can perform the task yourself – recording it with the PSR – and send that person the file. Now the person has the step-by-step instructions, along with screenshots. Very cool.

Some have gone so far as to call the Problem Steps Recorder a “miracle tool.” For those whose job it is to sit and listen to users describe their computer problems all day, it just might be.

Categories: Win 2003 Posted by yeejie on 11/6/2009 7:00 PM | Comments (0)

When I try to run either "Domain Controller Security  policy" or "Domain Security policy", from the administration menu, I get the error message stating "Failed to open the Group policy  object, You may not have appropriate rights".

Solution: Run "Dcgpofix.exe" in command prompt to restore the default setting. You may run into this error "SYSVOL share cannot be accessed at this time". Restart the machine will do.

Categories: Sharepoint Posted by yeejie on 10/27/2009 8:00 PM | Comments (0)

When you launched “SharePoint Products and Technologies Configuration Wizard” and got into this error:

Failed to start the database service MSSQL$OfficeServers.  Repair this product by selecting it from the Add/Remove Programs menu.

Here’s the solution: Go to “regedit”, browse thru “HKLM_Local_Machine/Software/Microsoft/Shared Tools/Web Server Extensions/12.0/WSS/”. Then change the value of attribute named “ServerRole” from SINGLESERVER to APPLICATION.

Thanks to Akshay’s Weblog (http://blogs.msdn.com/akshayns/archive/2007/08/14/unable-to-configure-sharepoint-products-and-technologies-configuration-wizard.aspx?CommentPosted=true#commentmessage).

Categories: Sharepoint, Win 2008 Posted by yeejie on 10/27/2009 8:00 PM | Comments (0)

If you try to install Project Server 2007 on Windows Server 2008 R2, the Setup program will give you an error message such as this one:

“The program is blocked due to compatibility issues.”


image-2-thumb

To overcome this error, you need to slipstream the latest sharepoint or project server updates to the respective “Updates” folder.

To install MOSS 2007 on Win 2008 R2, please refer to here.

To install Project Server 2007 on Win 2008 R2, please refer to here.

Categories: General Posted by yeejie on 7/26/2009 8:00 PM | Comments (0)

<Pasted from http://weblogs.asp.net/rmclaws/archive/2005/04/03/396941.aspx and Credit to Robert Mclaws>

Congratulations to all the new MVPs out there. Welcome to the team.

Every 3 months, a new round of MVPs are announced. So I thought I’d take a moment to write about the "Unofficial" Criteria for selecting an MVP. It is important to note that this is just my opinion, based on my experience dealing with the MVP Program… as well as a hefty helping of common sense.

  1. MVPs are Microsoft’s "volunteer army". They support the community in numerous ways that Microsoft couldn’t even begin to deal with. The best way to build a quality brand is to encourage customers to support other customers. It’s cheaper too ;). If Microsoft can give you better access to product teams and free software to keep you happy, it doesn’t cost them much. If they had to pay salary and benefits to every member of the community, their software would be nowhere near as successful.
  2. Microsoft MVPs are an important public face on the company. To that end, the company is obviously going to want some kind of control over what that face presents to the public. So they’re pretty selective on who they award an MVP to.
  3. If you look at the MVPs out there, Microsoft’s selection criteria typically mirror their criteria for selecting employees. Again, with good reason - these people will be granted a high level of interaction with the product teams. They don’t want someone dealing with the people they pay who will be disruptive to productivity. This is why many prominent Microsoft MVPs eventually get hired into the company.

So, if you want to become an MVP, here is my list of DOs and DON’Ts. They’ve worked well for me, although admittedly sometimes I don’t follow my own rules.

  • DON’T be rude, vulgar, or disrespectful in your communication with other community members. Swearing, while OK during coding sessions and casual conversation, should NEVER be used in communication that will be read by many. It is uncouth and represents an extreme lack of control and judgement.
  • DON’T be in it just for a title. If you’re looking to be the king of some imaginary social hierarchy, forget it. The MVP Program has been around a long time, and the Microsoft employees assigned to foster community and build the program will see right through you.
  • DON’T stop following these rules after you become an MVP. The honor is re-awarded yearly, and lots of people slack off and get dropped. As my daddy always said "I brought you into this world, I can take you out."
  • DON’T be a spoiled brat if you don’t like a decision Microsoft made. The Visual Basic MVP petition fiasco is a prime example. Microsoft wants responsible adults as part of their program, even if they are young.
  • DON’T cause PR problems for Microsoft. It takes several good deeds to become an MVP, but one PR issue could send you packing. Taking them to task on an issue is one thing, but if Microsoft has to clean up a PR mess, you’ll probably get taken out with the trash.
  • DON’T be elitist just because you’ve been in the industry for a while. You won’t be around forever, and someone younger than you will eventually take your place. In this industry, you can be relevant one day, irrelevant the next.
  • DO be courteous every time you deal with a fellow member of the community. Give them the respect they deserve as a person. (This works well in life, too.)
  • DO interact in the community in more than one way (weblogging in and of itself doesn’t get you in, you should also be involved in the newsgroups or Forums or something)
  • DO take extra time to understand Microsoft’s position on decisions, and speak respectfully on those issues.
  • DO have an opinion on things going on in the tech world. Take some time to establish yourself on an authority in a subject area, and then expand your reach into other areas.
  • DO be genuine in your desire to help others. Microsoft’s corporate culture is aimed towards the betterment of society. If that’s not the center of your personal culture, you’ll never be seriously considered.
  • DO excercise good judgement as often as possible. Rule of Thumb: Anything that will be indexed by a search engine should be well thought out before posting. Think ahead about whether you want that opinion associated with your name a year from now.
  • DO think of new ways to fill in the gaps Microsoft leaves in the community. If you have a crazy idea… try it out. You never know when you’ll be mentioned in the next executive keynote.
  • DO evaluate your communication skills constantly. The better you can relate Microsoft’s message to others, the more Microsoft will interact with you.
  • DO be consistent with your community work. You can’t help out 4 or 5 people a year and expect to be an MVP.
  • DO look out for your other community members, and encourage others (especially young people).

And, a note to anyone younger than 25 - stick with it. There isn’t an age requirement, so I wouldn’t be surprised if a 12 year old put there somewhere could smoke all these old guys ;).

Hopefully, that heps some aspiring MVPs out there. We’re always looking for new blood.

Categories: .NET Posted by yeejie on 7/8/2009 8:00 PM | Comments (0)

<pasted from http://blogs.msdn.com/dsimmons/archive/2008/05/17/why-use-the-entity-framework.aspx>

There are a number of places where you can read an introduction to the Entity Framework, listen to a podcast about it, or watch a screen cast or video of an interview.  Even with these various resources, though, there are so many different data access technologies out there that it’s not uncommon for me to get the question: Why should I use the Entity Framework?  Or what differentiates it from other options like just using ADO.Net SqlClient and friends, LINQ to SQL or something like nHibernate?  I like the second question better, because the truth is that different problems merit different solutions.  So here’s just a quick take on my perspective about these:

Entity Framework vs. traditional ADO.Net
All of the standard ORM arguments apply here.  The highlights are that you can write code against the Entity Framework and the system will automatically produce objects for you as well as track changes on those objects and simplify the process of updating the database.  The EF can therefore replace a large chunk of code you would otherwise have to write and maintain yourself.  Further, because the mapping between your objects and your database is specified declaratively instead of in code, if you need to change your database schema, you can minimize the impact on the code you have to modify in your applications–so the system provides a level of abstraction which helps isolate the app from the database.  Finally, the queries and other operations you write into your code are specified in a syntax that is not specific to any particular database vendor–in ado.net prior to the EF, ado.net provided a common syntax for creating connections, executing queries and processing results, but there was no common language for the queries themselves; ado.net just passed a string from your program down to the provider without manipulating that string at all, and if you wanted to move an app from Oracle to SQL Server, you would have to change a number of the queries.  With the EF, the queries are written in LINQ or Entity SQL and then translated at runtime by the providers to the particular back-end query syntax for that database.

Entity Framework vs. LINQ to SQL
The first big difference between the Entity Framework and LINQ to SQL is that the EF has a full provider model which means that as providers come online (and there are several in beta now and many which have committed to release within 3 months of the EF RTM), you will be able to use the EF against not only SQL Server and SQL CE but also Oracle, DB2, Informix, MySQL, Postgres, etc.

Next there is the fact that LINQ to SQL provides very limited mapping capabilities.  For the most part L2S classes must be one-to-one with the database (with the exception of one form of inheritance where there is a single table for all of the entity types in a hierarchy and a discriminator column which indicates which type a particular row represents).  In the case of the EF, there is a client-side view engine which can transform queries and updates made to the conceptual model into equivalent operations against the database.  The mapping system will produce those views for a variety of transformations.

You can apply a variety of inheritance strategies: Assume you have an inheritance model with animal, dog:animal & cat:animal.  You can not only do what L2S does and create a single table with all the properties from animal, dog & cat plus a column that indicates if a particular row is just a generic animal or a dog or a cat, but you can also have 3 tables where each table has all of the properties of that particular type (the dog table has not only dog-specific columns but also all the same columns as animal), or 3 tables such that the dog and cat tables have only the key plus those properties specific to their type of animal and retrieving a dog object would involve a join between the animal table and the dog table.  And you can further combine these strategies so some parts of a hierarchy might live in one table and some parts in separate tables.

In addition you can do what we call "entity splitting" where a single type has properties which are drawn from two separate tables, and you can model complex types where there is a type which is nested within a larger entity and which doesn’t have its own separate identity–it just groups some properties together.  The best example of this is something like address where the street, city, state and zip properties go together logically, but they don’t have independent identity.  The address is only interesting as a set of properties that are part of a customer or whatever.  As you have noticed, for v1 you can’t create complex types with the designer in the EF–you have to code them by hand in the XML files.

Entity Framework vs. nHibernate
Because nHibernate is a rather full-featured ORM, the distinguishing features between the EF and it are not as large.  In fact, it is certainly true that nHibernate is a more mature product and in many ways has more ORM features than the EF.  The big difference between the EF and nHibernate is around the Entity Data Model (EDM) and the long-term vision for the data platform we are building around it.  The EF was specifically structured to separate the process of mapping queries/shaping results from building objects and tracking changes.  This makes it easier to create a conceptual model which is how you want to think about your data and then reuse that conceptual model for a number of other services besides just building objects.  Long-term we are working to build EDM awareness into a variety of other Microsoft products so that if you have an Entity Data Model, you should be able to automatically create REST-oriented web services over that model (ADO.Net Data Services aka Astoria), write reports against that model (Reporting Services), synchronize data between a server and an offline client store where the data is moved atomically as entities even if those entities draw from multiple database tables on the server, create workflows from entity-aware building blocks, etc. etc.  Not only does this increase the value of the data model by allowing it to be reused for many parts of your overall solution, but it also allows us to invest more heavily in common tools which will streamline the development process, make developer learning apply to more scenarios, etc.  So the differentiator is not that the EF supports more flexible mapping than nHibernate or something like that, it’s that the EF is not just an ORM–it’s the first step in a much larger vision of an entity-aware data platform.

Credit to Dsimmons on this great write-up.

Categories: VPC Posted by yeejie on 7/7/2009 8:00 PM | Comments (0)

<Pasted from http://tednyberg.com/dotnet/2009/4/2/configure-a-network-between-a-host-computer-and-a-vpc,-virtual-pc>

Running a local LAN with your computer and any VPCs only

I’ve been getting some questions about how to set up a network between a VPC and the host computer without having access to an actual network. For example, I’m writing this post while sitting on an airplane, and this flight doesn’t come with an internet connection. However, I can still run a local network making the host computer and the VPC available to one another through TCP/IP. The answer is spelled Loopback Adapter.

Installing the Loopback Adapter

These instructions are for Windows Vista, but you can find instructions for Windows 2000 and Windows XP in the Virtual PC help documentation.

First, click Start » Control Panel » Hardware and Sound » Device Manager.

Next, click the Action menu and Add legacy hardware:

image

Click Install the hardware that I manually select from a list and then click Next:

image2

Select the Network adapters option and click Next:

image3

In the Manufacter list, select Microsoft, select Microsoft Loopback Adapter and then click Next:

image4

Click Next again to start installing the loopback network adapter:

image5

When it’s completed, click Finish. You’ll now have an additional network adapter available:

image6

Right-click the loopback network adapter and click Properties. Next select the Internet Protocol Version TCP/IPv4 settings and click Properties.

Now specify any private, non-routable static IP address (for example one starting with 192.168.x.x) that you want for the host computer:

image7

Enabling the loopback adapter in your VPC

Start your VPC and then click the Settings option on the Edit menu:

image8

Note: the VPC doesn’t have to be running, you can access these settings from the Virtual PC Console as well. In fact, if you want to increase or decrease the number of network adapters the VPC should have, you need to keep the VPC shut down while modifying the settings. Virtual PC doesn’t allow "hardware changes" while the VPC is running.

Click the Networking option and then set at least one network adapter to use the Microsoft Loopback Adapter:

image9

Once you’ve configured the VPC to use the loopback adapter you need to specify a static IP for the VPC as well:

image10

Now, just to make sure, I’ll try and ping the VPC from my "real" computer to see that we have network connectivity despite not having access to a real physical network:

image11

Note that you can use either the static IP we specified within the VPC or the VPC’s computer name to connect to it.

Big THANKS to Ted Nyberg for saving my day!

***

If you encountered problem in Win Vista or Win 7, please refer to http://beta.blogs.microsoft.co.il/blogs/baruchf/archive/2009/07/09/windows-7-amp-network-loopback-adapter-settings.aspx or below:

Pinging from host to guest worked but pinging back from guest to the host returned time out. After searching I found the problem is that  Windows 7 declares this network connection as undefined public network and blocks connections from it, but there is no way to change it to home or work network because this option is unavailable :-(

 image_thumb_60EE57E0

After spending a lot of time I found this great post that describes the same problem on vista and a way to solve it: set your loopback adapter connection (host) default gateway to the IP of the virtual machine then the network will be defined and you can change it to home or work .

image_thumb_09C9471D

Thanks to Baruch Frei!