<?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-8521969897431596073</id><updated>2024-09-04T16:05:38.777-07:00</updated><title type='text'>Microsoft Technology Development (.Net)</title><subtitle type='html'>AVINASH VYAS</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://avinash-vyas.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://avinash-vyas.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Avinash Vyas</name><uri>http://www.blogger.com/profile/08629585362098625668</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>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8521969897431596073.post-6977561696014675845</id><published>2011-01-13T07:11:00.000-08:00</published><updated>2011-01-13T07:11:53.402-08:00</updated><title type='text'>How to create Dynamic Where Clause in Linq</title><content type='html'>&lt;b&gt;C# Method:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;public IQueryable GetProductList(string whereClause)&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; var query = context.ItemMaster_Stage&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;&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; .Where(whereClause);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (IQueryable)query;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Method calling:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
IQueryable obj = new Products().GetProductList(&quot;it.ITEM_NAME == &#39;WEDDING BANDS&#39;&quot;);&lt;br /&gt;
&lt;br /&gt;
Here you can call this method with &#39;Where&#39; clause as per your requirement.</content><link rel='replies' type='application/atom+xml' href='http://avinash-vyas.blogspot.com/feeds/6977561696014675845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://avinash-vyas.blogspot.com/2011/01/how-to-create-dynamic-where-clause-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/6977561696014675845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/6977561696014675845'/><link rel='alternate' type='text/html' href='http://avinash-vyas.blogspot.com/2011/01/how-to-create-dynamic-where-clause-in.html' title='How to create Dynamic Where Clause in Linq'/><author><name>Avinash Vyas</name><uri>http://www.blogger.com/profile/08629585362098625668</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-8521969897431596073.post-8216220460726500822</id><published>2011-01-12T05:25:00.000-08:00</published><updated>2011-01-12T05:25:56.810-08:00</updated><title type='text'>Linq To Sql return from function as IQueryable</title><content type='html'>Following is the example illustrating how we can return IQueryable&amp;lt;T&amp;gt; from a method which has linq to SQL statements and bind returned data to a asp.net repeater control:&lt;br /&gt;
&lt;br /&gt;
public IQueryable GetParentCategory()&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; return (context.CategoryMaster&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Where(c =&amp;gt; c.PARENT_CATEGORY_ID == 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Select(c =&amp;gt; new { c.PARENT_CATEGORY_ID, c.CATEGORY_NAME, c.CATEGORY_ID })).AsQueryable(); &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
In above example we need only three fields (Projection) from data source. &lt;br /&gt;
&lt;br /&gt;
We can bind repeater with following code:&lt;br /&gt;
&lt;br /&gt;
rptParentCategory.DataSource = new Products().GetParentCategory(); &lt;br /&gt;
rptParentCategory.DataBind(); &lt;br /&gt;
&lt;br /&gt;
Here &#39;Product&#39; is a class in &#39;App_code&#39; containing method &#39;GetParentCategory&#39;.</content><link rel='replies' type='application/atom+xml' href='http://avinash-vyas.blogspot.com/feeds/8216220460726500822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://avinash-vyas.blogspot.com/2011/01/linq-to-sql-return-from-function-as.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/8216220460726500822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/8216220460726500822'/><link rel='alternate' type='text/html' href='http://avinash-vyas.blogspot.com/2011/01/linq-to-sql-return-from-function-as.html' title='Linq To Sql return from function as IQueryable&lt;T&gt;'/><author><name>Avinash Vyas</name><uri>http://www.blogger.com/profile/08629585362098625668</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>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8521969897431596073.post-6255412100022279384</id><published>2009-12-16T06:29:00.001-08:00</published><updated>2009-12-16T06:42:16.115-08:00</updated><title type='text'>JS Function to &#39;SELECT ALL&#39; /  &#39;CLEAR ALL&#39; for CheckBoxList Control</title><content type='html'>&lt;b&gt;JS FUNCTION:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function CheckBoxListSelect(cbControl, state)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;{ &amp;nbsp; &lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; var chkBoxList = document.getElementById(cbControl);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;var chkBoxCount= chkBoxList.getElementsByTagName(&quot;input&quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;for(var i=0;i&amp;lt;chkBoxCount.length;i++)&lt;br /&gt;
&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;chkBoxCount[i].checked = state;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return false;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;</content><link rel='replies' type='application/atom+xml' href='http://avinash-vyas.blogspot.com/feeds/6255412100022279384/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://avinash-vyas.blogspot.com/2009/12/js-function-to-select-all-de-select-all.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/6255412100022279384'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/6255412100022279384'/><link rel='alternate' type='text/html' href='http://avinash-vyas.blogspot.com/2009/12/js-function-to-select-all-de-select-all.html' title='JS Function to &#39;SELECT ALL&#39; /  &#39;CLEAR ALL&#39; for CheckBoxList Control'/><author><name>Avinash Vyas</name><uri>http://www.blogger.com/profile/08629585362098625668</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-8521969897431596073.post-8183371888040768115</id><published>2009-12-11T02:28:00.000-08:00</published><updated>2009-12-11T02:37:26.401-08:00</updated><title type='text'>ASP.Net Repeater: checkbox validation using javascript</title><content type='html'>&lt;b&gt;Javascript function for validating checkbox&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
The repeater control has two chechbox.&lt;br /&gt;
Following function will warn user if he selects second checkbox without selecting first checkbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function ValidateCB(cb2)&lt;br /&gt;
{&lt;br /&gt;
&lt;br /&gt;
//Get the object for Second Check box (Control ID is passed in method : this.id)&lt;br /&gt;
var cbSecondID = document.getElementById(cb2);&lt;br /&gt;
&lt;br /&gt;
//Contruct Control ID for First CheckBox, by replacing string (control id of second checkbox)&lt;br /&gt;
var cbFirstID = cbSecondID.id.replace(&quot;cb2&quot;,&quot;cb1&quot;);&lt;br /&gt;
&lt;br /&gt;
//Get the object for first checkbox&lt;br /&gt;
var cbFirst = document.getElementById(cbFirstID);&lt;br /&gt;
&lt;br /&gt;
//displays alert when first cb is not selected and we are attampting to select second one   &lt;br /&gt;
if (cbSecondID.checked == true &amp;&amp; cbFirst.checked == false)&lt;br /&gt;
{&lt;br /&gt;
alert(&quot;Please select first checkbox&quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
}</content><link rel='replies' type='application/atom+xml' href='http://avinash-vyas.blogspot.com/feeds/8183371888040768115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://avinash-vyas.blogspot.com/2009/12/aspnet-repeater-checkbox-validation.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/8183371888040768115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8521969897431596073/posts/default/8183371888040768115'/><link rel='alternate' type='text/html' href='http://avinash-vyas.blogspot.com/2009/12/aspnet-repeater-checkbox-validation.html' title='ASP.Net Repeater: checkbox validation using javascript'/><author><name>Avinash Vyas</name><uri>http://www.blogger.com/profile/08629585362098625668</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>2</thr:total></entry></feed>