<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3931774540462211731</id><updated>2026-01-18T11:43:34.885-08:00</updated><category term="C#"/><category term="MS SQL"/><category term="ASP.NET"/><category term="MVC"/><category term="Pass Parameters to View"/><category term="Windows 7"/><category term="Visual Studio"/><category term="IIS"/><category term="VB.NET"/><category term="VB.NET and Excel"/><title type='text'>How to do - MS SQL C# Excel Access</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>792</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-3322286778598041724</id><published>2022-07-15T12:07:00.005-07:00</published><updated>2022-07-15T12:13:24.406-07:00</updated><title type='text'>MVC - Display Nullable checkbox</title><content type='html'>&lt;br&gt;
Watch this example on YouTube:
&lt;br&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/bntzRI9bsvg?rel=0&amp;amp;autoplay=1&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br&gt;





&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Replace&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(x =&amp;gt; x.MyQuestions)&lt;/p&gt;&lt;p&gt;with&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; @Html.CheckBox(&quot;MyQuestions&quot;, Model.MyQuestions ?? false)&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/3322286778598041724/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-display-nullable-checkbox.html#comment-form' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3322286778598041724'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3322286778598041724'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-display-nullable-checkbox.html' title='MVC - Display Nullable checkbox'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/bntzRI9bsvg/default.jpg" height="72" width="72"/><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-4482202640364275330</id><published>2022-07-15T11:57:00.004-07:00</published><updated>2022-07-15T11:59:07.333-07:00</updated><title type='text'>MVC - Custom Validate Checkbox - Get checkbox value in JavaScript (client)</title><content type='html'>
&lt;br&gt;
Watch this example on YouTube:
&lt;br&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/Tx7mjoN9SK0?rel=0&amp;amp;autoplay=1&quot; style=&quot;background-image: url(https://i.ytimg.com/vi/Tx7mjoN9SK0/hqdefault.jpg);&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br&gt;










&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Validation&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public IEnumerable&amp;lt;ModelClientValidationRule&amp;gt; GetClientValidationRules(ModelMetadata metadata, ControllerContext context)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var rule = new ModelClientValidationRule&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ValidationType = &quot;validatecheckbox&quot;,&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ErrorMessage = &quot;Fix it!&quot;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; };&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; rule.ValidationParameters.Add(&quot;fields&quot;, string.Join(&quot;,&quot;, _fields));&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; yield return rule;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2. JS&lt;/p&gt;&lt;p&gt;$.validator.addMethod(&#39;validatecheckbox&#39;, function (value, element, params) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; debugger&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; var isValid = true;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if ($(params)[0].fields[1].val() == &quot;True&quot;){&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt; if ($(params)[0].fields[0][0].checked &lt;/span&gt;&lt;/b&gt;== false) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; isValid = false;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;});&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/4482202640364275330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-custom-validate-checkbox-get.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4482202640364275330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4482202640364275330'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-custom-validate-checkbox-get.html' title='MVC - Custom Validate Checkbox - Get checkbox value in JavaScript (client)'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/Tx7mjoN9SK0/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-7319896911839496522</id><published>2022-07-13T13:21:00.008-07:00</published><updated>2022-07-13T13:26:11.304-07:00</updated><title type='text'>MVC - How to make a read only checkbox </title><content type='html'>&lt;br&gt;
Watch this example on YouTube:
&lt;br&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/bbp75mBe2xQ?rel=0&amp;amp;autoplay=1&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br&gt;







&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Replace&amp;nbsp;&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid.Value, new { id = item.EmployeeID})&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;br /&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;with&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid.Value, new { id = item.EmployeeID, &lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;@disabled = &quot;true&quot;&lt;/span&gt;&lt;/b&gt;})&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;br /&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/7319896911839496522/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-how-to-make-read-only-checkbox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7319896911839496522'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7319896911839496522'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-how-to-make-read-only-checkbox.html' title='MVC - How to make a read only checkbox '/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/bbp75mBe2xQ/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-4844168152428035595</id><published>2022-07-13T12:01:00.008-07:00</published><updated>2022-07-13T12:19:38.096-07:00</updated><title type='text'>MVC - Fix Error - CS0428: Cannot convert method group &#39;GetValueOrDefault&#39; to non-delegate type &#39;bool&#39;. Did you intend to invoke the method?</title><content type='html'>&lt;br&gt;
Watch this example on YouTube:
&lt;br&gt;

&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/ypEo9rBpFa0?rel=0&amp;amp;autoplay=1&quot; style=&quot;background-image: url(https://i.ytimg.com/vi/ypEo9rBpFa0/hqdefault.jpg);&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br&gt;




&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;To fix it replace&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid.&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;GetValueOrDefault&lt;/span&gt;&lt;/b&gt;, new { id = item.EmployeeID })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;with&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid.&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;Value&lt;/span&gt;&lt;/b&gt;, new { id = item.EmployeeID })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/4844168152428035595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-fix-error-cs0428-cannot-convert.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4844168152428035595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4844168152428035595'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mvc-fix-error-cs0428-cannot-convert.html' title='MVC - Fix Error - CS0428: Cannot convert method group &#39;GetValueOrDefault&#39; to non-delegate type &#39;bool&#39;. Did you intend to invoke the method?'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/ypEo9rBpFa0/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-1569317811965831167</id><published>2022-07-13T11:42:00.005-07:00</published><updated>2022-07-13T11:47:08.580-07:00</updated><title type='text'>Fix Error CS0266 Cannot implicitly convert type &#39;bool?&#39; to &#39;bool&#39;. An explicit conversion exists (are you missing a cast?)</title><content type='html'>&lt;div&gt;&lt;br /&gt;&lt;/div&gt;

&lt;div&gt;Watch this example on YouTube:&lt;/div&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/dHHVw3lDSwI?rel=0&amp;amp;autoplay=1&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;


&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;to fix it replace&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid, new { id = item.EmployeeID })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;with&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;@using (Html.BeginForm(null, null, FormMethod.Post))&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; if (Model.myEmployees != null)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; foreach (var item in Model.myEmployees)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.CheckBoxFor(modelItem =&amp;gt; item.IsValid&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;.Value&lt;/span&gt;&lt;/b&gt;, new { id = item.EmployeeID })&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Html.DisplayFor(modelItem =&amp;gt; item.FirstName)&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/1569317811965831167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/fix-error-cs0266-cannot-implicitly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/1569317811965831167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/1569317811965831167'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/fix-error-cs0266-cannot-implicitly.html' title='Fix Error CS0266 Cannot implicitly convert type &#39;bool?&#39; to &#39;bool&#39;. An explicit conversion exists (are you missing a cast?)'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/dHHVw3lDSwI/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-414626248973586395</id><published>2022-07-13T11:11:00.008-07:00</published><updated>2022-07-13T11:16:22.140-07:00</updated><title type='text'>CS0119 &#39;Employee List&#39; is a type, which is not valid in the given context</title><content type='html'>


Watch this example on YouTube:&lt;div&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/PiANqm-es74?rel=0&amp;amp;autoplay=1&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;
&lt;br /&gt;


&lt;p&gt;&amp;nbsp;To fix this error replace (semicolon) in view&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;b&gt;&lt;span style=&quot;color: red;&quot;&gt;;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;with&lt;/p&gt;&lt;p&gt;@model WebApplication3.Models.EmployeeList&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/414626248973586395/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/cs0119-employee-list-is-type-which-is.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/414626248973586395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/414626248973586395'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/cs0119-employee-list-is-type-which-is.html' title='CS0119 &#39;Employee List&#39; is a type, which is not valid in the given context'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/PiANqm-es74/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-2316277007823562323</id><published>2022-07-12T12:27:00.004-07:00</published><updated>2022-07-12T12:32:03.856-07:00</updated><title type='text'>MSSQL - Check if varchar contains specified characteer</title><content type='html'>
&lt;br&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;270&quot; src=&quot;https://youtube.com/embed/qdytqplLb6M?rel=0&amp;amp;autoplay=1&quot; style=&quot;background-image: url(https://i.ytimg.com/vi/qdytqplLb6M/hqdefault.jpg);&quot; width=&quot;480&quot;&gt;&lt;/iframe&gt;

&lt;br&gt;


&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Declare @Test varchar(100) = &#39;aaa@aaa&#39;;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;IF @Test Like &#39;%@%&#39;&lt;/p&gt;&lt;p&gt;BEGIN&lt;/p&gt;&lt;p&gt;&amp;nbsp; print &#39; contains @&#39;&lt;/p&gt;&lt;p&gt;END&lt;/p&gt;&lt;p&gt;ELSE&lt;/p&gt;&lt;p&gt;BEGIN&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;print &#39; doesn&#39;&#39;t contain @&#39;&lt;/p&gt;&lt;p&gt;END&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/2316277007823562323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mssql-check-if-varchar-contains.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2316277007823562323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2316277007823562323'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2022/07/mssql-check-if-varchar-contains.html' title='MSSQL - Check if varchar contains specified characteer'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/qdytqplLb6M/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-3821444891841908923</id><published>2021-04-06T14:12:00.004-07:00</published><updated>2021-04-06T14:14:29.277-07:00</updated><title type='text'>MSSQL - How to increase length of existing varchar</title><content type='html'>&lt;p&gt;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/13HU4DHGRdc?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;ALter Table Test01&lt;br /&gt;Alter Column RealName Varchar(100)&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/3821444891841908923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-how-to-increase-length-of.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3821444891841908923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3821444891841908923'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-how-to-increase-length-of.html' title='MSSQL - How to increase length of existing varchar'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/13HU4DHGRdc/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-2133644361889461507</id><published>2021-04-06T14:09:00.004-07:00</published><updated>2021-04-06T14:11:39.824-07:00</updated><title type='text'>MSSQL - Rename column in table</title><content type='html'>&lt;p&gt;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/UyjS1MIolq4?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;exec sp_rename &#39;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;TableName&lt;/b&gt;&lt;/span&gt;.&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;CurrentColumnName&lt;/b&gt;&lt;/span&gt;&#39;, &#39;&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;NewColumnName&lt;/span&gt;&lt;/b&gt;&#39;, &#39;COLUMN&#39;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/2133644361889461507/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-rename-column-in-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2133644361889461507'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2133644361889461507'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-rename-column-in-table.html' title='MSSQL - Rename column in table'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/UyjS1MIolq4/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-3227948418305131433</id><published>2021-04-06T14:07:00.002-07:00</published><updated>2021-04-06T14:08:50.810-07:00</updated><title type='text'>MSSQL - Rename table</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;


&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/W7YbAx80mdY?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;exec sp_rename &#39;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;CurrentTableName&lt;/b&gt;&lt;/span&gt;&#39; , &#39;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;NewTableName&lt;/b&gt;&lt;/span&gt;&#39; &lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/3227948418305131433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-rename-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3227948418305131433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3227948418305131433'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-rename-table.html' title='MSSQL - Rename table'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/W7YbAx80mdY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-6732835841661707323</id><published>2021-04-05T14:37:00.002-07:00</published><updated>2021-04-05T14:38:45.336-07:00</updated><title type='text'>MSSQL - Fix Error - Column names in each table must be unique. Column name &#39;IsValid&#39; in table &#39;Test1&#39; is specified more than once.</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/odyK5F9JCxY?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;To fix it replace&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Alter Table Test1&lt;br /&gt;Add IsValid bit not null Default 0&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;with&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;IF COL_LENGTH(&#39;dbo.Test1&#39;, &#39;IsValid&#39;) Is Null&lt;br /&gt;Begin&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Alter Table Test1&lt;br /&gt;Add IsValid bit not null Default 0&lt;br /&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;End&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/6732835841661707323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-fix-error-column-names-in-each.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6732835841661707323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6732835841661707323'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-fix-error-column-names-in-each.html' title='MSSQL - Fix Error - Column names in each table must be unique. Column name &#39;IsValid&#39; in table &#39;Test1&#39; is specified more than once.'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/odyK5F9JCxY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-8343015584318850494</id><published>2021-04-05T14:34:00.003-07:00</published><updated>2021-04-05T14:35:55.049-07:00</updated><title type='text'>MSSQL - Add column only if it doesn&#39;t exist</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/v7DOGp5URV0?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;IF COL_LENGTH(&#39;dbo.Test3&#39;, &#39;IsValid&#39;) is null&lt;br /&gt;Begin&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;Alter Table Test3 Add IsValid bit not null default 0&lt;br /&gt;End&lt;br /&gt;&lt;br /&gt;Select * from Test3 &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/8343015584318850494/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-add-column-only-if-it-doesnt-exist.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/8343015584318850494'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/8343015584318850494'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-add-column-only-if-it-doesnt-exist.html' title='MSSQL - Add column only if it doesn&#39;t exist'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/v7DOGp5URV0/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-6203314946737510896</id><published>2021-04-05T14:30:00.002-07:00</published><updated>2021-04-05T14:32:46.325-07:00</updated><title type='text'>MSSQL  - Fix Error - ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column &#39;IsValid&#39; cannot be added to non-empty table &#39;Test1&#39; because it does not satisfy these conditions.</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;


&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/a6vuxttdh8s?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;To fix it replace&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Alter Table Test1&lt;br /&gt;Add IsValid bit not null&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;with&amp;nbsp;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Alter Table Test1&lt;br /&gt;Add IsValid bit not null&lt;b&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt; Default 0&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/6203314946737510896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-fix-error-alter-table-only-allows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6203314946737510896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6203314946737510896'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mssql-fix-error-alter-table-only-allows.html' title='MSSQL  - Fix Error - ALTER TABLE only allows columns to be added that can contain nulls, or have a DEFAULT definition specified, or the column being added is an identity or timestamp column, or alternatively if none of the previous conditions are satisfied the table must be empty to allow addition of this column. Column &#39;IsValid&#39; cannot be added to non-empty table &#39;Test1&#39; because it does not satisfy these conditions.'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/a6vuxttdh8s/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-5456057611889030089</id><published>2021-04-01T14:03:00.004-07:00</published><updated>2021-04-01T14:14:58.286-07:00</updated><title type='text'>MVC5 - Add modal (popup dialog)</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;br /&gt;


&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/OyX_18CeOh8?rel=0&amp;amp;autoplay=1
&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;1. View&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;@{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewBag.Title = &quot;Home Page&quot;;&lt;br /&gt;}&lt;br /&gt;&amp;lt;div class=&quot;AddPopUp&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Html.Label(&quot;Add pop up&quot;)&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;div class=&quot;modal fade&quot; id=&quot;MyPopUp&quot; role=&quot;dialog&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;modal-dialog&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;modal-content&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;modal-body&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; here are going your controls etc&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&lt;br /&gt;@section Scripts{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function () {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&quot;.AddPopUp&quot;).click(function (e) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(&#39;#MyPopUp&#39;).modal(&#39;show&#39;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/script&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2. CSS&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;.modal-content{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 500px;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 700px;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/5456057611889030089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mvc5-add-modal-popup-dialog.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/5456057611889030089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/5456057611889030089'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/04/mvc5-add-modal-popup-dialog.html' title='MVC5 - Add modal (popup dialog)'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-2407545534751176304</id><published>2021-03-19T14:18:00.004-07:00</published><updated>2021-03-19T14:20:05.243-07:00</updated><title type='text'>MVC - Simplest Extension Method example</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/ZzZohehijSM?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;1. Model&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp; public interface IExtensionTest&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void DoSomething();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class ExtensionTest: IExtensionTest&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void DoSomething() { }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static class SomethingElse {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static string ReturnSomething(this IExtensionTest t, string s)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;returning: &quot; + s;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2. Controller&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ActionResult Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IExtensionTest e = new ExtensionTest();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var res = e.ReturnSomething(&quot;bbbbb&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/2407545534751176304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-simplest-extension-method-example.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2407545534751176304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2407545534751176304'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-simplest-extension-method-example.html' title='MVC - Simplest Extension Method example'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/ZzZohehijSM/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-7542166362634922540</id><published>2021-03-19T14:14:00.006-07:00</published><updated>2021-03-19T14:17:37.002-07:00</updated><title type='text'>MVC - C# - Check if DateTime is today</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/PT8EEDabhyM?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;/p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DateTime d = Convert.ToDateTime(&quot;1/1/2000&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (d != DateTime.Today)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something here.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } </content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/7542166362634922540/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-datetime-is-today.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7542166362634922540'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7542166362634922540'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-datetime-is-today.html' title='MVC - C# - Check if DateTime is today'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/PT8EEDabhyM/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-2012336896990169333</id><published>2021-03-19T14:11:00.004-07:00</published><updated>2021-03-19T14:13:55.068-07:00</updated><title type='text'>MVC - C# - Check if time is greater than something</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;



&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/G4YLkycRsvw?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;



&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan startSomething = new TimeSpan(8, 0, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan endSomething = new TimeSpan(16, 0, 0);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TimeSpan now = DateTime.Now.TimeOfDay;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ((now &amp;gt; startSomething) &amp;amp;&amp;amp; (now &amp;lt; endSomething))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/2012336896990169333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-time-is-greater-than.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2012336896990169333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/2012336896990169333'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-time-is-greater-than.html' title='MVC - C# - Check if time is greater than something'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/G4YLkycRsvw/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-4335788452420019133</id><published>2021-03-19T14:08:00.003-07:00</published><updated>2021-03-19T14:10:55.755-07:00</updated><title type='text'>MVC - C# - Check if today is Friday (check todays day name)</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/qU3xgzepSWY?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;



&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (System.DateTime.Now.DayOfWeek == DayOfWeek.Friday)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // do somehting here&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/4335788452420019133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-today-is-friday-check.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4335788452420019133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4335788452420019133'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-check-if-today-is-friday-check.html' title='MVC - C# - Check if today is Friday (check todays day name)'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/qU3xgzepSWY/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-3494029503576940994</id><published>2021-03-19T14:05:00.003-07:00</published><updated>2021-03-19T14:07:35.980-07:00</updated><title type='text'>MVC - C# - Convert Now to Universal Time UTC</title><content type='html'>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/fXa_91GdgsY?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; String t = Convert.ToDateTime(DateTime.Now).ToUniversalTime().ToString(&quot;yyyy/MM/dd HH:mm UTC&quot;);&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/3494029503576940994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-convert-now-to-universal-time-utc.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3494029503576940994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3494029503576940994'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-convert-now-to-universal-time-utc.html' title='MVC - C# - Convert Now to Universal Time UTC'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/fXa_91GdgsY/default.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-8905397579778541179</id><published>2021-03-19T14:02:00.003-07:00</published><updated>2021-03-19T14:04:26.902-07:00</updated><title type='text'>MVC - C# - Format Date</title><content type='html'>&lt;p&gt;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;br /&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/-uoHYo00PQU?rel=0&amp;amp;autoplay=1&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;








&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;MVC - C# - Format Date&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/8905397579778541179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-format-date.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/8905397579778541179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/8905397579778541179'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-c-format-date.html' title='MVC - C# - Format Date'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/-uoHYo00PQU/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-1268922712637330233</id><published>2021-03-18T13:58:00.001-07:00</published><updated>2021-03-18T14:00:45.671-07:00</updated><title type='text'>Bat file to execute PowerShell</title><content type='html'>&lt;p&gt;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;


&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/y-UYf-vFrgE?rel=0&amp;amp;autoplay=1&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;1. PowerShell File&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;$wshell = New-Object -ComObject Wscript.Shell&lt;br /&gt;$wshell.Popup(&quot;Hello World&quot;, 0, &quot;Done&quot;, 0x1)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2. Bat file&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;Powershell.exe -executionpolicy remotesigned -File &quot;C:\Temp\PopupTest.ps1&quot;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/1268922712637330233/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/bat-file-to-execute-powershell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/1268922712637330233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/1268922712637330233'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/bat-file-to-execute-powershell.html' title='Bat file to execute PowerShell'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/y-UYf-vFrgE/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-6429130228770476130</id><published>2021-03-17T14:12:00.004-07:00</published><updated>2021-03-17T14:14:34.087-07:00</updated><title type='text'>MVC - How to call async method from controller</title><content type='html'>&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;Watch this example on YouTube&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;br /&gt;
  
  
  
  
  
  &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/-z-_8E5GG_o?rel=0&amp;amp;autoplay=1&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
  
  
  &lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;1. Task&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;using System.Web.Mvc;&lt;br /&gt;using System.Threading.Tasks;&lt;br /&gt;&lt;br /&gt;namespace ValidateOnDbSide.Controllers&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class BusinessController : Controller&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public async Task&amp;lt;string&amp;gt; DoSomething()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return await Task.Run(() =&amp;gt; test());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public string test()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return &quot;test&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2. Controller&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;using System.Threading.Tasks;&lt;br /&gt;&lt;br /&gt;namespace ValidateOnDbSide.Controllers&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class HomeController : Controller&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CompanyEntities db = new CompanyEntities();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public async Task&amp;lt;ActionResult&amp;gt; Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessController b = new BusinessController();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Task c = b.DoSomething();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string res = await b.DoSomething();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/6429130228770476130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-how-to-call-async-method-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6429130228770476130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/6429130228770476130'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-how-to-call-async-method-from.html' title='MVC - How to call async method from controller'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/-z-_8E5GG_o/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-4258313120081588602</id><published>2021-03-17T14:09:00.003-07:00</published><updated>2021-03-17T14:11:05.978-07:00</updated><title type='text'>MVC - Fix Error -  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the &#39;await&#39; operator to the result of the call.</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/j33X5_6v9Xg?rel=0&amp;amp;autoplay=1&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/p&gt;&lt;p&gt;&amp;nbsp;Because this call is not awaited, execution of the current method 
continues before the call is completed. Consider applying the &#39;await&#39; 
operator to the result of the call.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;To fix it replace&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ActionResult Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessController b = new BusinessController();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b.DoSomething();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;with&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;using System.Threading.Tasks; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public async Task&amp;lt; ActionResult&amp;gt; Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BusinessController b = new BusinessController();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; await b.DoSomething();&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/4258313120081588602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-fix-error-because-this-call-is-not.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4258313120081588602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/4258313120081588602'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-fix-error-because-this-call-is-not.html' title='MVC - Fix Error -  Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the &#39;await&#39; operator to the result of the call.'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/j33X5_6v9Xg/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-7903779982103097630</id><published>2021-03-17T14:00:00.004-07:00</published><updated>2021-03-17T14:03:05.608-07:00</updated><title type='text'>MVC - Add scrollbar to @Html.DisplayFor</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/yXUzP0bn_EI&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture?rel=0&amp;amp;autoplay=1&quot; allowfullscreen&gt;&lt;/iframe&gt;

&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;1.CSS&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;.LongText{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; word-wrap:break-word;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height: 10em;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; width: 20em;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; overflow-y: scroll;&lt;br /&gt;}&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2.View&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class=&quot;LongText&quot;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @Html.DisplayFor(x =&amp;gt; x.Description)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/7903779982103097630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-add-scrollbar-to-htmldisplayfor.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7903779982103097630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/7903779982103097630'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-add-scrollbar-to-htmldisplayfor.html' title='MVC - Add scrollbar to @Html.DisplayFor'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/yXUzP0bn_EI/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3931774540462211731.post-3041618560344825158</id><published>2021-03-16T14:00:00.003-07:00</published><updated>2021-03-16T14:02:19.354-07:00</updated><title type='text'>MVC - Prevent Double clicking</title><content type='html'>&lt;p&gt;&amp;nbsp;Watch this example on YouTube&lt;/p&gt;&lt;p&gt;&lt;br /&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/b_rRCY_2pf0?rel=0&amp;amp;autoplay=1&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;1. View&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;@{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ViewBag.Title = &quot;Home Page&quot;;&lt;br /&gt;}&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;SUBMIT&quot; /&amp;gt;&lt;br /&gt;&amp;lt;input type=&quot;submit&quot; value=&quot;CANCEL&quot; /&amp;gt;&lt;br /&gt;&lt;br /&gt;@section Scripts{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $(document).ready(function () {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var clickNum = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; jQuery(&#39;input[type=submit]&#39;).click(function (event) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.value == &#39;CANCEL&#39;) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clickNum = 0;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (clickNum &amp;gt; 0) {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert(&quot;Wait!!!!!&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return false;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clickNum++;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;}&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;b&gt;2. Controller&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ActionResult Index()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [HttpPost]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public ActionResult Index(string test = &quot;&quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Timers.Timer t = new System.Timers.Timer(2000);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return View();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;p&gt;&amp;nbsp;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/feeds/3041618560344825158/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-prevent-double-clicking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3041618560344825158'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3931774540462211731/posts/default/3041618560344825158'/><link rel='alternate' type='text/html' href='http://howtodomssqlcsharpexcelaccess.blogspot.com/2021/03/mvc-prevent-double-clicking.html' title='MVC - Prevent Double clicking'/><author><name>HowToCSharpMsSqlExcelAccess</name><uri>http://www.blogger.com/profile/06906927517525220164</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/b_rRCY_2pf0/default.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>