<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Caught By .Net!</title>
  <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/" />
  <link rel="self" href="http://blog.stoneskins.com/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2011-09-23T13:31:11.7682-04:00</updated>
  <author>
    <name>stoneskin</name>
  </author>
  <subtitle>Stoneskin's Notes</subtitle>
  <id>http://blog.stoneskins.com/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>Fix the Jquery selectBox double init cause old selction not work issue</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/09/23/FixTheJquerySelectBoxDoubleInitCauseOldSelctionNotWorkIssue.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,8e123c21-24df-4d0a-a7a8-704e839e9634.aspx</id>
    <published>2011-09-23T13:25:15.6262-04:00</published>
    <updated>2011-09-23T13:31:11.7682-04:00</updated>
    <category term="JQuery" label="JQuery" scheme="http://blog.stoneskins.com/CategoryView,category,JQuery.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">My Ajax call replace a dropdown box, 
then call 
<br />
$('select').each(function () {<br />
              $(this).selectBox();<br />
            });<br /><br />
to update the jquery selectBox look and feel again.<br /><br />
but it caused the "setting is undefined: settings.menuTransition" error, 
<br /><br />
to fixed that need add 
<br /><br />
            $('select').each(function
() {<br />
               
$(this).selectBox('destroy');<br />
               
<br />
            });<br />
Before the Ajax Call, so the next time you Initial it .the dropdown will be function..<br /></div>
    </content>
  </entry>
  <entry>
    <title>JQuery Ajax and MVC3 Ajax</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/09/16/JQueryAjaxAndMVC3Ajax.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,895e08d2-e349-4582-a7c8-4ca6296791d0.aspx</id>
    <published>2011-09-16T00:44:31.726-04:00</published>
    <updated>2011-09-16T13:32:28.745-04:00</updated>
    <category term="JQuery" label="JQuery" scheme="http://blog.stoneskins.com/CategoryView,category,JQuery.aspx" />
    <category term="MVC" label="MVC" scheme="http://blog.stoneskins.com/CategoryView,category,MVC.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">check the JQuery Ajax:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px">$.ajax({
type: <span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"POST"</span>,
url: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">this</span>.url,
data: form_data, beforeSend: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#ajaxDetails').addClass('progress'); }, error: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#status').text('Update failed—<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">try</span> again.').slideDown('slow');
}, success: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#status').text('Update successful!'); }, complete: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#ajaxDetails').removeClass('progress'); setTimeout(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#status').slideUp('slow'); }, 3000); } });</span></pre><br />
to get the from data:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">var</span> form_data <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span> $(<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"form"</span>).serialize(); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">var</span> form_data_array <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span> $(<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"form"</span>).serializeArray();</span></pre>a
simple example:<br /><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px">$(document).ready(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span>()
{ $('#submit').click(<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span> ()
{ <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">var</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">name</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span> $('.uname').val(); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">var</span> data <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span> 'uname=' <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">+</span><span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">name</span>;
$.ajax({ type:<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"GET"</span>,
url:<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"welcome.php"</span>,
data: data, success: <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">function</span> (html)
{ $('#<span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">message</span>').html(html);
} }); <span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">return</span> false;
}); });<br /><br /><br />
and MVC3 Ajax<br /></span></pre><pre><span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px">@<span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">using</span> (Ajax.BeginForm( 
<br /><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"ActionName"</span>, 
<br /><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"ControllerName"</span>, 
<br /><span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px">new</span> AjaxOptions
{<br />
 UpdateTargetId <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"modal-dialog"</span>, 
<br />
OnFailure="searchFailed", 
<br />
OnBegin <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"Dialog.Updating()"</span>, 
<br />
OnSuccess <span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px">=</span><span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"Dialog.Update({title:'Select
Friends'})"</span><br />
})) { 
<br />
… &lt;input type=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"submit"</span> value=<span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px">"Next"</span> /&gt; 
<br />
} </span></pre><br /><br /><br /><br /><p></p></div>
    </content>
  </entry>
  <entry>
    <title>My First MVC3 remote validation</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/09/10/MyFirstMVC3RemoteValidation.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,dba569a6-a722-4aec-b0fc-f659ba7bf66e.aspx</id>
    <published>2011-09-10T01:05:07.186-04:00</published>
    <updated>2011-09-12T09:42:09.7859628-04:00</updated>
    <category term="Asp.net" label="Asp.net" scheme="http://blog.stoneskins.com/CategoryView,category,Aspnet.aspx" />
    <category term="MVC" label="MVC" scheme="http://blog.stoneskins.com/CategoryView,category,MVC.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="html">I created a new MVC project, and test the remote validation in the about page. &lt;br&gt;
&lt;br&gt;
1)Controller Home: 
&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;public&lt;/span&gt; ActionResult
ValidateTestName(&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;string&lt;/span&gt; testName)
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;return&lt;/span&gt; Json(!testName.Equals(&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"test"&lt;/span&gt;),
JsonRequestBehavior.AllowGet); }&lt;/span&gt;&lt;/pre&gt;2)Model:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;using&lt;/span&gt; System.Web.Mvc; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;namespace&lt;/span&gt; MvcApplication1.Models
{ &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;class&lt;/span&gt; AboutModel
{ [Required] [Remote(&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"ValidateTestName"&lt;/span&gt;, &lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"Home"&lt;/span&gt;,
ErrorMessage &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;=&lt;/span&gt; &lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"this
Name already be used."&lt;/span&gt;)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;string&lt;/span&gt; TestName
{ get; set; } [Required] [Range(20, 44)] &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;public&lt;/span&gt; &lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;int&lt;/span&gt; Age
{ get; set; } } }&lt;/span&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt; &lt;/span&gt;&lt;/pre&gt;3)View:&lt;br&gt;
In _Layout.cshtml:&lt;br&gt;
&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;
&lt;head&gt;
&lt;script src=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"@Url.Content("
&lt;/span&gt;~/Scripts/jquery-1.5.1.&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;min&lt;/span&gt;.js&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;")"&lt;/span&gt; type=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"text/javascript"&lt;/span&gt;&gt;&gt;
&lt;script src=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier
New; font-size: 11px"&gt;"@Url.Content("&lt;/span&gt;~/Scripts/jquery.validate.js&lt;span style="color:
#666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;")"&lt;/span&gt;
type=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier
New; font-size: 11px"&gt;"text/javascript"&lt;/span&gt;&gt;&gt;
&lt;script src=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"@Url.Content("&gt;~/Scripts/jquery.validate.unobtrusive.js&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;")"&lt;/span&gt; type=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"text/javascript"&lt;/span&gt;&gt;&lt;/script&gt;
&lt;/head&gt;&lt;/span&gt;&lt;/pre&gt;In About.cshtml&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;span style="color: Black; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;@model MvcApplication1.Models.AboutModel
@{
    ViewBag.Title &lt;span style="color: Red; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;=&lt;/span&gt; &lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"About Us"&lt;/span&gt;;
}

&lt;h2&gt;About&lt;/h2&gt;
&lt;p&gt;
     Put content here.
     @&lt;span style="color: Blue; background-color: Transparent; font-family: Courier New; font-size: 11px"&gt;using&lt;/span&gt; (Html.BeginForm())
     {
         @Html.EditorForModel();
                               
        &lt;input type=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"submit"&lt;/span&gt; value=&lt;span style="color: #666666; background-color: #e4e4e4; font-family: Courier New; font-size: 11px"&gt;"Submit"&lt;/span&gt; /&gt;                      
     }
&lt;/p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br&gt;It is working perfect under FireFox 6:&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://blog.stoneskins.com/content/binary/MyFirstRemoteValidation.png" border="0"&gt;&lt;br&gt;&lt;br&gt;but not working in my IE9 :(...&lt;br&gt;I have &lt;a href="http://jquery.bassistance.de/validate/jquery-validation-1.8.1.zip"&gt;downloaded &lt;/a&gt;&lt;span class="comment-copy"&gt;&lt;a href="http://stackoverflow.com/questions/5571724/asp-net-mvc-3-remote-validation-problem"&gt;Jquery.Validation 1.8.1&lt;/a&gt; try to fix this issue, but looks still unlucky.&lt;br&gt;(Jquery.Validation site : http://bassistance.de/jquery-plugins/jquery-plugin-validation/)&lt;br&gt;&lt;br&gt;&lt;br&gt;but this &lt;a href="http://stackoverflow.com/questions/5571724/asp-net-mvc-3-remote-validation-problem"&gt;post in stack overflow&lt;/a&gt; said it tested in &lt;/span&gt; Chrome 10.0, IE9 and FireFox 4.0</content>
  </entry>
  <entry>
    <title>scottGu's MVC3 Razor introducing</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/08/22/scottGusMVC3RazorIntroducing.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,2da02bf7-dab4-4988-8607-a64ba7b66000.aspx</id>
    <published>2011-08-22T15:46:07.23-04:00</published>
    <updated>2011-08-22T16:56:09.281-04:00</updated>
    <category term="MVC" label="MVC" scheme="http://blog.stoneskins.com/CategoryView,category,MVC.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <br />
        <a href="http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx">http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx </a>
        <br />
        <ul>
          <font>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx" target="_blank">Introducing
Razor (July 2nd)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/10/19/asp-net-mvc-3-new-model-directive-support-in-razor.aspx">New
@model keyword in Razor (Oct 19th)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/10/22/asp-net-mvc-3-layouts.aspx">Layouts
with Razor (Oct 22nd)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/11/12/asp-net-mvc-3-server-side-comments-with-razor.aspx">Server-Side
Comments with Razor (Nov 12th)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/12/15/asp-net-mvc-3-razor-s-and-lt-text-gt-syntax.aspx">Razor’s
@: and &lt;text&gt; syntax (Dec 15th)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/12/16/asp-net-mvc-3-implicit-and-explicit-code-nuggets-with-razor.aspx" target="_blank">Implicit
and Explicit code nuggets with Razor (Dec 16th)</a>
            </li>
            <li>
              <a href="http://weblogs.asp.net/scottgu/archive/2010/12/30/asp-net-mvc-3-layouts-and-sections-with-razor.aspx">Layouts
and Sections with Razor (Today)</a>
            </li>
          </font>
        </ul>
for other MVC stuff:<br /><br /><a href="http://weblogs.asp.net/scottgu/archive/tags/MVC/default.aspx">http://weblogs.asp.net/scottgu/archive/tags/MVC/default.aspx</a><br /></div>
    </content>
  </entry>
  <entry>
    <title>how to input Trademark </title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/08/16/howToInputTrademark.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,171de132-91a4-43e6-8c01-98efdbca69cc.aspx</id>
    <published>2011-08-16T12:35:37.177-04:00</published>
    <updated>2011-08-25T09:13:29.513-04:00</updated>
    <category term="WebDesign" label="WebDesign" scheme="http://blog.stoneskins.com/CategoryView,category,WebDesign.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">http://fsymbols.com/computer/trademark/#windows<br /><br />
hold alt and input 0153 you will got ™<br />
0174 you will got ®<br /><br />
to put/replace them in string: 
<br />
str.Replace("&amp;#174;","\u00AE").Replace("&amp;#174", "\u00AE").<br />
                   
Replace("&amp;#0153;", "\u2122")<br /><br /><br />
some time you need use <span role="treeitem" class="nodeLabelBox repTarget ">&lt;<span class="nodeTag ">sup</span><span class="nodeBracket editable insertBefore ">&gt;</span><span class="nodeText editable "><span class="nodeTextEntity  ">&amp;reg;</span></span>&lt;/<span class="nodeTag ">sup</span>&gt;
in html<br /></span><p></p></div>
    </content>
  </entry>
  <entry>
    <title>my old projects list</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/08/16/myOldProjectsList.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,45f4df11-56f6-4620-b685-138671f37980.aspx</id>
    <published>2011-08-15T20:47:25.32-04:00</published>
    <updated>2011-08-15T20:52:19.14-04:00</updated>
    <category term="ProjectManagement" label="ProjectManagement" scheme="http://blog.stoneskins.com/CategoryView,category,ProjectManagement.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">this file is made last year before I changed
job. 
<br /><br /><p></p><a href="http://blog.stoneskins.com/content/binary/Favorite%20Projects.docx">Favorite
Projects.docx (17.61 KB)</a></div>
    </content>
  </entry>
  <entry>
    <title>说说在MVC开发中,遇到的错误及解决方法</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/07/19/%e8%af%b4%e8%af%b4%e5%9c%a8MVC%e5%bc%80%e5%8f%91%e4%b8%ad%e9%81%87%e5%88%b0%e7%9a%84%e9%94%99%e8%af%af%e5%8f%8a%e8%a7%a3%e5%86%b3%e6%96%b9%e6%b3%95.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,9ea08e7a-5493-430e-be8b-8661165a571a.aspx</id>
    <published>2011-07-19T00:27:49.125-04:00</published>
    <updated>2011-07-19T00:29:47.9782-04:00</updated>
    <category term="MVC" label="MVC" scheme="http://blog.stoneskins.com/CategoryView,category,MVC.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div id="cnblogs_post_body">
          <a href="http://www.cnblogs.com/lori/archive/2011/07/18/2109817.html">http://www.cnblogs.com/lori/archive/2011/07/18/2109817.html</a>
          <br />
          <br />
          <p>
前提:数据底层,使用的是MVC架构,对于数据表中的状态及相关字段,采用了枚举型进行对应
</p>
          <p>
 
</p>
          <p>
1 序列中不包含任何元素 
<br />
  解决：将Single()改为DefaultOrSingle() 
</p>
          <p>
2 序列包含一个以上的元素 
<br />
  解决：很多情况都是原始数据的问题 
</p>
          <p>
3 不能在已使用的实体上添加新实体 
<br />
4 Duplicate key is already , 
<br />
  3,4的解决为：用  base._db.ExecuteCommand()进行SQL语句的重写，
</p>
          <p>
不要用LINQ自带的insert,就不会出现错误了 
</p>
          <p>
5  未将对象引用设置到对象的实例。 值不能为空。参数名: source。 
<br />
   解决：  this.iProduct_ProductFilesRepository.Insert(_entity.Product_ProductFile.Cast&lt;Entity.IDataEntity&gt;
().ToList());，当遇到将list实体类型换为接口list规范时，应该用.Cast&lt;接口类型&gt;().ToList() 
</p>
          <p>
6 查询参数不能为“System.Object”类型。 
<br />
解决：这是因为在LINQ的ExecuteCommand不理解空值,当我们传递的参数为 null 时，就会出现这个问题，解决方法是，在为实体加string.empty这个空值属性 
</p>
          <p>
7  Incorrect syntax near '@p0'. 
<br />
解决：查看我们的SQL代码，被编译成了什么，可能是多个括号之类的。如：delete from users where (userid={0}，这很明显是不对的，哈哈 
</p>
          <p>
8 不支持SQL的转化 
<br />
   解决1，看看是否用了枚举类型，如果用了，应该先把IQueryable进行ToList，得到真正的数据后才能进行判断 
<br />
   解决2,请看你的原始数据，很有可以是数据问题 
<br />
   解决3,请看程序代码的关联表查询，很可能是它没有找出数据的问题 
</p>
          <p>
9  未将对象引用设置到对象的实例。 
<br />
解决：查看数据库向数据实体赋值时，枚举类型的字段是否为null了，如果为null，就会出错 
</p>
          <p>
10    查询包含对不同数据上下文上所定义项的引用。 
<br />
解决：查看底层工厂建立是否返回datacontext有问题，是否为空了。 
</p>
          <p>
11    枚举在LINQ中引发的异常：不支持SQL转换 
<br />
    当枚举使用字符名称，没有数据，然它的数值存储在数据表中时，我们在返回数据时，必须在ToList()才行，否则就会出现这种问题 
<br />
    例如： 
<br />
     /// &lt;summary&gt; 
<br />
     /// 以下是一个积分类型的枚举，一种类型对应数据表中同样类型的一个数值 
<br />
     /// &lt;/summary&gt; 
<br />
   public enum PrestigeTypeCode 
<br />
    { 
<br />
           IAsk_Question, 
<br />
            IAsk_Answer, 
<br />
  } 
</p>
          <p>
  //表据表如下： 
<br />
ID    描述        数值   
枚举名称 
<br />
1   提问           1   
IAsk_Question 
<br />
2   回答           1   
IAsk_Answer 
</p>
          <p>
结论：当我们通过枚举去从数据库（SQLSERVer里）取数值时，必须要把结果集ToList()才行，如代码： 
<br />
int value = new PrestigeTypesRepository().GetPrestigeTypes().ToList().Where(item =&gt;
item.PrestigeTypeCode == prestigeTypeCode).Single().Amount; 
<br />
如果，枚举的值，在枚举元素里读上，就不用去tolist()了 
</p>
          <p>
12 不能将 Null 值赋给类型为 System.Int32 (不可为 null 的值类型)的成员 
<br />
解决:应该是数据的问题,Int类型的SQL表中出来了NULL值,或者是由于枚举类型转换失败的原因
</p>
        </div>
        <p>
        </p>
      </div>
    </content>
  </entry>
  <entry>
    <title>Setup Windows Server 2008 to enable net.tcp for WCF</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/05/25/SetupWindowsServer2008ToEnableNettcpForWCF.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,b9bef2ae-460a-46d2-9399-9f05f89e609b.aspx</id>
    <published>2011-05-25T12:33:21.286-04:00</published>
    <updated>2011-05-25T12:48:48.8220052-04:00</updated>
    <category term="WCF" label="WCF" scheme="http://blog.stoneskins.com/CategoryView,category,WCF.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">1. if net.tcp not enable on the server,
you will see "The protocol 'net.tcp' is not supported." error message:<br /><p></p><img src="http://blog.stoneskins.com/content/binary/nettcpbind_not_supported.png" border="0" height="560" width="782" /><br /><br />
2. You need install and turn on the feature in Control panel\Programs and features:<br /><br /><img src="http://blog.stoneskins.com/content/binary/enable_tcp_step1.png" border="0" height="560" width="782" /><img src="http://blog.stoneskins.com/content/binary/enable_tcp_step2.png" border="0" height="560" width="782" /><br /><br />
3. then enable the protocols of your service:<br /><br /><img src="http://blog.stoneskins.com/content/binary/enable_tcp_step3.png" border="0" height="560" width="782" /><br /><br />
4. set up the binding port:<br /><br /><img src="http://blog.stoneskins.com/content/binary/enable_tcp_step4.png" border="0" height="560" width="782" /><br /><br />
5. done. it should be work, if not work, check those step again and the binding address
in you web.config file.<br />
I will post my service code and client code later.<br /></div>
    </content>
  </entry>
  <entry>
    <title>ILMerge merge multiple dlls into single dll file</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/05/24/ILMergeMergeMultipleDllsIntoSingleDllFile.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,b0ccbacc-a4f5-4b11-891e-297ffc510bb3.aspx</id>
    <published>2011-05-23T22:44:10.424-04:00</published>
    <updated>2011-05-23T22:56:41.5598004-04:00</updated>
    <category term="VS 2005" label="VS 2005" scheme="http://blog.stoneskins.com/CategoryView,category,VS2005.aspx" />
    <category term="VS 2008" label="VS 2008" scheme="http://blog.stoneskins.com/CategoryView,category,VS2008.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">ILmerge.exe <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=22914587-b4ad-4eae-87cf-b14ae6a939b0&amp;displaylang=en&amp;pf=true" target="_blank">download
link</a> from Microsoft.<br /><br />
info:<a href="http://research.microsoft.com/en-us/people/mbarnett/ILMerge.aspx" target="_blank"> http://research.microsoft.com/en-us/people/mbarnett/ILMerge.aspx</a><br /><p>
For example, the following command could be issued to combine one primary assembly
and two secondary assemblies into a single merged DLL file:
</p><div class="code">ilmerge /out:Merged.dll Primary.dll Secondary1.dll Secondary2.dll<br /><br />
using wildcard:<br />
ilmerge /wildcards /out:Merged.dll Primary.dll Secondary*.dll<br /><br />
log:<br />
ilmerge /log:log.txt /out:Merged.dll Primary.dll Secondary1.dll Secondary2.dll<br /></div><br /></div>
    </content>
  </entry>
  <entry>
    <title>WCF netTcpBinding Client with Windows Authentication and Transport Security </title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/05/21/WCFNetTcpBindingClientWithWindowsAuthenticationAndTransportSecurity.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,6b114515-a416-4b6e-9768-8946c3697900.aspx</id>
    <published>2011-05-21T01:14:06.42-04:00</published>
    <updated>2011-05-21T01:25:54.0740004-04:00</updated>
    <category term="WCF" label="WCF" scheme="http://blog.stoneskins.com/CategoryView,category,WCF.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p class="title">
from:(<a href="http://msdn.microsoft.com/en-us/library/ff647180.aspx#Step4">http://msdn.microsoft.com/en-us/library/ff647180.aspx</a>)<br /></p>
        <h1 class="heading">Step 7: Create a Test Client Application
</h1>
        <p>
In this step, you create a Windows Forms application named Test Client to test the
WCF service.
</p>
        <ol>
          <li>
Right-click your solution, click <strong>Add</strong>, and then click <strong>New
Project</strong>.</li>
          <li>
In the <strong>Add New Project</strong> dialog box, in the <strong>Templates</strong> section,
select <strong>Windows Forms Application</strong>.</li>
          <li>
In the <strong>Name</strong> field, type <strong>Test Client</strong> and then click <strong>OK</strong> to
create a Windows Forms application.</li>
          <li>
Right-click your client project and then click <strong>Add Service Reference</strong>.</li>
          <li>
In the <strong>Add Service Reference</strong> dialog box, set the <strong>Service
URI:</strong> to <strong>net.tcp://localhost:8523/WCFTestService</strong> and then
click <strong>Go</strong>. 
</li>
          <li>
Change the <strong>Service reference name:</strong> to <strong>WCFTestService</strong> and
then click <strong>OK</strong>.</li>
        </ol>
        <a id="Step8">
          <span>
          </span>
        </a>
        <h1 class="heading">Step 8: Test the Client and WCF Service
</h1>
        <p>
In this step, you use the test client to ensure that the WCF service is running properly.
</p>
        <ol>
          <li>
In your client project, drag a button control onto your form.</li>
          <li>
Double-click the button control to show the underlying code. 
</li>
          <li>
In the code behind the button click, create an instance of the proxy, and call the <strong>DoWork()</strong> method
of your WCF service. 
<p>
When you call the service, your current user security context will automatically be
passed to your WCF service. The code should look as follows:
</p><div class="LW_CodeSnippetContainer"><a name="CodeSpippet10"></a><div class="LW_CodeSnippetContainerCodeCollection"><div id="CodeSnippetContainerCode10" class="LW_CodeSnippetContainerCode"><div style="color:Black;"><pre>private void button1_Click(object sender, EventArgs e)
{
      WCFTestService.MyServiceClient myService = 
         new WCFTestService.MyServiceClient();
      MessageBox.Show(myService.DoWork("Hello World!"));
      myService.Close();
}

</pre></div></div></div></div></li>
          <li>
Right click the client project and then click <strong>Set as Startup Project</strong>.</li>
          <li>
Run the client application by pressing F5 or CTRL+F5. 
<p>
When you click the button on the form, the message “Welcome Hello World!” should appear.
</p></li>
        </ol>
other ref:  
<br /><p id="ctl00_TitleArea_ArticleTitle"><a href="http://www.codeproject.com/KB/WCF/WCFMultipleHosting.aspx">Host your WCF
service with multiple host environment using multiple protocol</a></p><p></p></div>
    </content>
  </entry>
  <entry>
    <title>Config net.tcp binding in server iis7.0 command line server 2008</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2011/05/21/ConfigNettcpBindingInServerIis70CommandLineServer2008.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,912cff9b-1df5-497b-8df4-61df705d90f9.aspx</id>
    <published>2011-05-21T01:11:23.168-04:00</published>
    <updated>2011-05-21T01:23:14.8620004-04:00</updated>
    <category term="WCF" label="WCF" scheme="http://blog.stoneskins.com/CategoryView,category,WCF.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <strong>(this one is for 2003 server<br /><a href="http://www.singingeels.com/Articles/Duplex_WCF_Services_Hosted_in_IIS_Using_NetTcp.aspx">http://www.singingeels.com/Articles/Duplex_WCF_Services_Hosted_in_IIS_Using_NetTcp.aspx</a><br />
)<br /><br />
Below content from unknown source:<br /><br />
step 1<br /></strong>
        <br />
make sure the window services related to was  is running 24/7. Please ensure
that svc - integrated handler is working properly in IIS 7.0.  This step is very
important. Make sure the IIS 7.0 is working perfectly. You should also have administrative
prevliages on you machine. 
<br /><br /><strong>step 2<br /></strong><br />
In the adminstravtive command  make sure the website is enable to accept the
net.tcp protocol or the UI interface in the IIS 7.0 will help  you  to
do it. The command is given below. This command should be at the adminstrative command
in window server 2008. This process is one time activity.<br /><strong><br />
%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='8000:*']<br /></strong><br /><strong>step 3<br /></strong><br />
After your web application is created , mapping to your phsyical directory in your
machine. You must enable the web application to accept net.tcp protocol.  The
sample dos command is given below and this command should be run in the administrative
command in window server 2008<br /><br /><strong>%windir%\system32\inetsrv\appcmd.exe set app "Default Web Site/ Application
Name” /enabledProtocols:http;net.tcp<br /><br />
step 4</strong><p>
In the Microsoft.NET Framework 3.0, enable the Window Communication Foundation Non-HTTP
activation.  Kindly ensure that the two features like Window communication foundation
HTTP Activation, XPS Viewer in Microsoft.NET Framework 3.0 should also be enabled. 
</p><ul><li>
From the Start menu, choose Control Panel.</li><li>
Select Programs and Features. 
</li><li>
Click Turn Windows Components on or Off.</li><li>
Expand the Microsoft .NET Framework 3.0 node and check the Windows Communication Foundation
Non-HTTP Activation feature</li></ul><p><br /><strong>step 5<br /></strong><br />
In the Window Features , enable all the features of window process activation service.
The features to be enabled are .Net environment, Configuration API ,Process Model. 
</p><ul><li>
From the Start menu, choose Control Panel.</li><li>
Select Programs and Features. 
</li><li>
Click Turn Windows Components on or Off.</li><li>
Expand Window Process Activation Process Activation.</li></ul><p><br /><strong>step 6<br /></strong><br />
The Turn User Account Control should be turned off , in the case if you are trying
to host  WAS service in a new machine. If the user account is turned on then
it is not possible to host the WCF Service in IIS 7.0. 
</p><ul><li>
Click start 
</li><li>
Go to Setting and click the control panel</li><li>
Select the User Control</li><li>
Click on the Turn User Account Control on or off</li></ul><p><br /><strong>step 7<br /><br /></strong>In the Internet Information Service , enable the features which are given
below. the IIS Metabase and IIS 6 configuration compatibility which comes under web
management tools. 
</p><p>
From the Start menu, choose Control Panel.<br />
Select Programs and Features. 
<br />
Click Turn Windows Components on or Off.<br />
Expand Internet Information Service.<br /></p><p><strong>step 8<br /></strong><br />
Microsoft Front Page Server Exemptions Extensions 
</p><p>
If Microsoft Front Page Server Exemptions extension is not installed in the machine, 
<br />
Install using the following URL<br />
       <a href="http://www.iis.net/downloads/default.aspx?tab&amp;g=6&amp;i=1577">http://www.iis.net/downloads/default.aspx?tabid=34&amp;g=6&amp;i=1577</a><br /></p><p><strong>step  9 -  ServiceModel Registration Tool (ServiceModelReg.exe)</strong></p><p>
For information on <strong>ServiceModelReg</strong> , visit the url which is given
below. It is very important
</p><a href="http://msdn.microsoft.com/en-us/library/ms732012.aspx">http://msdn.microsoft.com/en-us/library/ms732012.aspx</a><br /><br /><br /><strong>Sample application for WAS Hosting you can you use from the URL which are
given below<br /></strong><br /><a href="http://msdn.microsoft.com/en-us/library/ms752218.aspx">http://msdn.microsoft.com/en-us/library/ms752218.aspx</a><br /><p></p></div>
    </content>
  </entry>
  <entry>
    <title>SourceGear announced that Fortress 2.0 is now Vault Professional Edition 5.1(Nov 1st 2010)</title>
    <link rel="alternate" type="text/html" href="http://blog.stoneskins.com/2010/11/11/SourceGearAnnouncedThatFortress20IsNowVaultProfessionalEdition51Nov1st2010.aspx" />
    <id>http://blog.stoneskins.com/PermaLink,guid,f2818215-7aa1-41c1-bb55-a12577acff5f.aspx</id>
    <published>2010-11-11T11:29:44.107-05:00</published>
    <updated>2010-11-11T11:36:47.1856631-05:00</updated>
    <category term="Agile" label="Agile" scheme="http://blog.stoneskins.com/CategoryView,category,Agile.aspx" />
    <category term="ProjectManagement" label="ProjectManagement" scheme="http://blog.stoneskins.com/CategoryView,category,ProjectManagement.aspx" />
    <author>
      <name>stoneskin</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">My Vault Demo slids for in our company IT
managers<br /><p></p><a href="http://blog.stoneskins.com/content/binary/Vault1.ppt">Vault1.ppt (64 KB)</a><br /><div><font size="4"><b>Why change? Why Vault?</b></font></div><b><br />
VSS Does not offer cheap branching, so we hesitate to create branches. Also does not
support ActionScript type filenames which forced us to use Subversion for FLEX development.
Now we straddle using two Version Control systems.<br />
Vault combines the best of VSS and Subversion and adds some enhancements of its own.<br />
Surveyed about 20 Version Control systems. Several are cheaper(free), Several are
more powerful (AccuRev, Team Concert). Vault has by far the lowest learning curve,
has the essential features and is priced competitively.<br /><br /><br /><br /></b><br /></div>
    </content>
  </entry>
</feed>
