<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>I Learnt Today... &#187; Menol</title>
	<atom:link href="http://www.ilearnttoday.com/author/menol/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ilearnttoday.com</link>
	<description>This is where I share what I learn day by day...</description>
	<lastBuildDate>Fri, 18 May 2012 13:36:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How To Choose Between ItemsSource and DataContext</title>
		<link>http://www.ilearnttoday.com/how-to-choose-between-itemssource-and-datacontext</link>
		<comments>http://www.ilearnttoday.com/how-to-choose-between-itemssource-and-datacontext#comments</comments>
		<pubDate>Fri, 24 Feb 2012 16:28:07 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[DataBinding]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Databind]]></category>
		<category><![CDATA[DataContext]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[Difference Between DataContext and ItemsSource]]></category>
		<category><![CDATA[FrameworkElement]]></category>
		<category><![CDATA[ItemsSource]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=600</guid>
		<description><![CDATA[2012-02-24 I usually use ItemsSource property when I need to databind a control in WPF because it&#8217;s straightforward and the<a href="http://www.ilearnttoday.com/how-to-choose-between-itemssource-and-datacontext" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2012-02-24</span><br />
<script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-5478118713208336"; /* <span class="mceItemHidden"><span class="mceItemHiddenSpellWord">LeadIn</span></span> */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>I usually use <strong>ItemsSource</strong> property when I need to <strong>databind</strong> a control in <strong>WPF</strong> because it&#8217;s straightforward and the framework does everything for me.</p>
<p>However, I came accross a situation where I had to do all data formatting and stuff for a <strong>DataGrid</strong>. In such a case the best method is to use the DataContext property.</p>
<p>The DataContext property is available for pretty much any item you use under the .net framework because it is implemented in the<strong> FrameworkElement.</strong> What you need to know about <strong>FrameworkElement</strong> to understand <strong>DataContext</strong> is that it is one of the very top level classes in the .net framework class hierarchy which is inherited by many classes beneath it.</p>
<p>The ItemsSource property on the other hand is implemented in the ItemsControl class which is located far below in the .net class hierarchy and therefore only inherited by a sub set of controls you use.</p>
<p><strong>What is DataContext</strong></p>
<p>As the name suggests this property sets the data context for an item. In other words it sets the bigger picture (something similar to saying this text box is should be bound to some data element within this particular data table, but you have to tell me what exactly that element is). So when you set the data context property, then you have to specify databindings explicitly.</p>
<p>Data context is usually used to databind controls such as forms which would include sub controls that need to be bound to sub elements of the data context.</p>
<p>For example, a form would include text boxes for First Name and Last Name. Instead of databinding each control you can set the datacontext property of the form so that both FirstName and LastName textboxes would get relevant data automatically.</p>
<p>Following example shows a simple use of DataContext:</p>
<p>First take a note at the two XAML lines for two text boxes which tells the framework what fields of the datacontext each text box should be bound to</p>
<pre class="brush: xml; title: ; notranslate">
</pre>
<p>Now following code sets the datacontext of the whole window. (Notice this.DataContext)</p>
<pre class="brush: csharp; title: ; notranslate">
// create a simple data source
DataTable _dt = new DataTable();
_dt.Columns.Add(new DataColumn(&quot;Id&quot;, typeof(int)));
_dt.Columns.Add(new DataColumn(&quot;FirstName&quot;, typeof(string)));
_dt.Columns.Add(new DataColumn(&quot;LastName&quot;, typeof(string)));

_dt.Rows.Add(1, &quot;Robin&quot;, &quot;Hood&quot;);
_dt.Rows.Add(2, &quot;Spider&quot;, &quot;Man&quot;);
_dt.Rows.Add(3, &quot;Knight&quot;, &quot;Rider&quot;);

this.DataContext = _dt;
</pre>
<p><strong><span style="text-decoration: underline;">Output</span></strong></p>
<p><strong></strong><a href="http://www.ilearnttoday.com/wp-content/uploads/2012/02/datacontext-ilearnttody.com_1.png"><img class="alignleft size-full wp-image-612" title="datacontext-ilearnttody.com" src="http://www.ilearnttoday.com/wp-content/uploads/2012/02/datacontext-ilearnttody.com_1.png" alt="How to use datacontext in WPF - sample use of datacontext" width="217" height="119" /></a></p>
<p><script type="text/javascript">// <![CDATA[
 google_ad_client = "ca-pub-5478118713208336"; /* <span class="mceItemHidden"><span class="mceItemHiddenSpellWord">BelowPost</span></span>_<span class="mceItemHidden"><span class="mceItemHiddenSpellWord">BlendIn</span></span> */ google_ad_slot = "0823141458"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p><strong>ItemsSource</strong></p>
<p>On the other hand, Items source setting does all the binding work for you so all you have to do is to set the items source property of your control to any collection that implements IEnumerable interface.</p>
<p>Following example shows how you can simply data bind a datagrid using ItemsSource property:</p>
<pre class="brush: csharp; title: ; notranslate">

// create a simple data source
DataTable _dt = new DataTable();
_dt.Columns.Add(new DataColumn(&quot;Id&quot;, typeof(int)));
_dt.Columns.Add(new DataColumn(&quot;First Name&quot;, typeof(string)));
_dt.Columns.Add(new DataColumn(&quot;Last Name&quot;, typeof(string)));

_dt.Rows.Add(1, &quot;Robin&quot;, &quot;Hood&quot;);
_dt.Rows.Add(2, &quot;Spider&quot;, &quot;Man&quot;);
_dt.Rows.Add(3, &quot;Knight&quot;, &quot;Rider&quot;);

// DgTestGrid is a dimple datagrid
this.DgTestGrid.ItemsSource = _dt.DefaultView;
</pre>
<p><span style="text-decoration: underline;"><strong>Output</strong></span></p>
<p><strong></strong><a href="http://www.ilearnttoday.com/wp-content/uploads/2012/02/itemssource-ilearnttody.com_1.png"><img class="alignleft size-medium wp-image-611" title="itemssource-ilearnttoday.com" src="http://www.ilearnttoday.com/wp-content/uploads/2012/02/itemssource-ilearnttody.com_1-300x200.png" alt="How to use itemssource - sample use of itemssource" width="300" height="200" /></a></p>
<p><strong>Note</strong></p>
<p>The data table, _dt is not used straightaway as the items source but its <strong>DefaultView</strong> is used instead. This is because the <strong>DataTable</strong> (System.Data.DataTable) class does not implement the IEnumerable interface but its <strong>DefaultView</strong> (System.Data.Dataview) does.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/how-to-choose-between-itemssource-and-datacontext/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use LIKE operator in Dataview.RowFilter for Date Time or Numaric Fields using CONVERT</title>
		<link>http://www.ilearnttoday.com/dataview-row-filter-for-date-time</link>
		<comments>http://www.ilearnttoday.com/dataview-row-filter-for-date-time#comments</comments>
		<pubDate>Mon, 16 Jan 2012 11:58:58 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Autofilter Datagrid]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[CONVERT]]></category>
		<category><![CDATA[datagrid]]></category>
		<category><![CDATA[Datagrid Rowfilter]]></category>
		<category><![CDATA[Dataview]]></category>
		<category><![CDATA[Date Time]]></category>
		<category><![CDATA[Datetime]]></category>
		<category><![CDATA[Fields]]></category>
		<category><![CDATA[LIKE operator]]></category>
		<category><![CDATA[Numaric]]></category>
		<category><![CDATA[Row filter]]></category>
		<category><![CDATA[RowFilter]]></category>
		<category><![CDATA[using CONVERT]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=577</guid>
		<description><![CDATA[2012-01-16 The RowFilter property of the DataView allows to use flexible string similar to SQL or LINQ to easily filter<a href="http://www.ilearnttoday.com/dataview-row-filter-for-date-time" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2012-01-16</span><br />
<script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-5478118713208336"; /* LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>The RowFilter property of the DataView allows to use flexible string similar to SQL or LINQ to easily filter rows wihtout having to iterate through them.</p>
<p>I had to implement a fully flexible search module for a project I&#8217;m working on. The user had to be able to perform a string search on any field displayed on the gridview. The above mentioned RowFilter method is really handy to provide such a functionality due to increased efficiency.</p>
<p>Assume following example:</p>
<p><strong>The data table (in the database)</strong></p>
<p><span style="text-decoration: underline;">Field Name         Data Type  </span></p>
<p>Name                String</p>
<p>DateOfBirth        DateTime</p>
<p><strong><span style="text-decoration: underline;">Data</span></strong></p>
<p>Name                     DOB</p>
<p>John                      1976-10-12</p>
<p>Sophie                   1990-12-30</p>
<p>If you want to use the RowFilter to enable flexible searching (i.e. if the user type &#8220;j&#8221; in the search textbox the search grid view would only show the record for John) you can use following code:</p>
<pre class="brush: csharp; title: ; notranslate">
string SearchFor = SearchTextBox.Text;
((DataView)SearchGrid.DataContext).RowFilter = string.Concat(&quot;Name LIKE '%&quot;, SearchFor, &quot;%'&quot;);
</pre>
<p>This will allow the above explained behaviour so if the user now enter &#8220;h&#8221; in the textbox it will show both records because both John and Sophie have the letter &#8220;h&#8221; in their names.</p>
<p>So what if we repeat the same and use the following code for the date of birth field?</p>
<pre class="brush: csharp; title: ; notranslate">
// WRONG CODE
string SearchFor = SearchTextBox.Text;
((DataView)SearchGrid.DataContext).RowFilter = string.Concat(&quot;DateOfBirth LIKE '%&quot;, SearchFor, &quot;%'&quot;);
</pre>
<p>We would expect the program to filter records similarly. However, if you enter &#8220;1990&#8243; in the search textbox hoping it would filter Sophie, it would give you an error instead!</p>
<p>This is because the LIKE operator cannot work with non-charactor types.</p>
<p><strong>The Solution!</strong></p>
<p>We have to use a converter to convert the datetime field into a string just before the RowFilter is applied.</p>
<p><strong>Here&#8217;s the code:</strong></p>
<pre class="brush: csharp; title: ; notranslate">
string SearchFor = SearchTextBox.Text;
((DataView)SearchGrid.DataContext).RowFilter = string.Concat(&quot;CONVERT(DateOfBirth, System.String) LIKE '%&quot;, SearchFor, &quot;%'&quot;);
</pre>
<p>The Convert function will cast the datetime value into string just before the LIKE operation takes place. And since the datetime value is only temperory converted, the original data are not affected as well.</p>
<p>So if you add this code to the previously worked code for the Name column as described below:</p>
<pre class="brush: csharp; title: ; notranslate">
string SearchFor = SearchTextBox.Text;
((DataView)SearchGrid.DataContext).RowFilter = string.Concat(&quot;Name LIKE '%&quot;, SearchFor, &quot;%'&quot;);
((DataView)SearchGrid.DataContext).RowFilter = string.Concat(&quot;CONVERT(DateOfBirth, System.String) LIKE '%&quot;, SearchFor, &quot;%'&quot;);
</pre>
<p><span style="text-decoration: underline;"><strong>The Result</strong></span></p>
<p><script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-5478118713208336"; /* BelowPost_BlendIn */ google_ad_slot = "0823141458"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script></p>
<p><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script>Now if you type &#8220;John&#8221; the grid will only show records that match that value and if you type a digit (e.g. 30) it will show the record that has 30 in the dob field (i.e. the record for Sophie)</p>
<p><strong>Note<br />
</strong>You can use the same method for any other field type which doesn&#8217;t support use of LIKE directly.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/dataview-row-filter-for-date-time/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Using TimeStamp columns to keep track of database record versions</title>
		<link>http://www.ilearnttoday.com/timestamp-columns</link>
		<comments>http://www.ilearnttoday.com/timestamp-columns#comments</comments>
		<pubDate>Fri, 07 Oct 2011 14:27:47 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[@@DBTS]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[database version]]></category>
		<category><![CDATA[insert into a timestamp column]]></category>
		<category><![CDATA[record version]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Timestamp]]></category>
		<category><![CDATA[version]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=543</guid>
		<description><![CDATA[2011-10-07 Timestamp is a value that is incremented by the database whenever an insert or update operation is performed. Even<a href="http://www.ilearnttoday.com/timestamp-columns" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2011-10-07</span><br />
<script type="text/javascript">// <![CDATA[
      google_ad_client = "ca-pub-5478118713208336"; /* LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>Timestamp is a value that is incremented by the database whenever an insert or update operation is performed.</p>
<p>Even though the name Timestamp could be a bit misleading, this value has no relevance to a clock related time. This only shows a linear progression of time.</p>
<p>For an example , it is something like your database saying it has been two update or insert commands since your last visit.</p>
<p>You can see this value by referring to <a>@@DBTS</a>  [ select @@DBTS ]</p>
<p><div id="attachment_544" class="wp-caption alignnone" style="width: 212px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/1.png"><img class="size-full wp-image-544" title="Database Timestamp Value" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/1.png" alt="Database Timestamp Value" width="202" height="117" /></a><p class="wp-caption-text">Database Timestamp Value</p></div><br />
<br />
How can this be helpful at all?</p>
<p>Well, in simple terms, this helps to keep track of versions of records.</p>
<p>For an example, assume a scenario where you have to fetch a record from a table, manipulate the data and write it back.</p>
<p>What if the record gets changed (from another database call) after you fetched data? You will manipulate the old data and update the record without knowing somebody has updated the record in between your fetching and updating commands.</p>
<p>How can timestamp help?</p>
<p>You can add a column to your table (you can call it &#8220;Version&#8221;) and set its data type to TimeStamp. Then whenever you update or insert a record to this table, this column will record the database timestamp after that transaction.</p>
<p>So before writing your manipulated data, you can check if the timestamp value remains the same as what you read at the beginning of the transaction.</p>
<p>Following example demonstrates how timestamp can be used to monitor versions:</p>
<p>The Person table used for this example has a column called &#8220;Version&#8221; which is of type Timestamp.</p>
<p>First simply query the Version column of the table for the person called &#8220;Robert&#8221;</p>
<p><div id="attachment_546" class="wp-caption alignnone" style="width: 609px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_before1.png"><img class="size-full wp-image-546" title="Timestamp before update" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_before1.png" alt="Timestamp before update" width="599" height="155" /></a><p class="wp-caption-text">Timestamp before update</p></div><br />
<br />
After an update to the same record, we will check the version (timestamp) of the same record:</p>
<p><div id="attachment_548" class="wp-caption alignnone" style="width: 585px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_after.png"><img class="size-full wp-image-548" title="Timestamp after update" src="http://www.ilearnttoday.com/wp-content/uploads/2011/10/person_after.png" alt="Timestamp after update" width="575" height="181" /></a><p class="wp-caption-text">Timestamp after update</p></div><br />
<br />
As you can see, the timestamp value for the record has been automatically updated.</p>
<p>Note: Timestamp columns are automatically updated by the database engine so you do not have to specify value when either inserting or updating a row of a table which has a timestamp (version) column.</p>
<p>So to insert a record to a table with a timestamp column simply omit the timestamp column from your insert statement.</p>
<p>i.e. &#8211; Person table has following columns [Id, Given_Name, Family_Name, Age, Version]</p>
<p>Insert statement would be:</p>
<pre class="brush: sql; title: ; notranslate">
Insert into Person(Id, Given_Name, Family_Name, Age)
Values(001, &quot;Robert&quot;, &quot;Nox&quot;, 78);
</pre>
<p>
The database will take care of the timestamp (version) column.</p>
<p><script type="text/javascript">// <![CDATA[
     google_ad_client = "pub-5478118713208336"; /* BelowPost_BlendIn */ google_ad_slot = "0823141458"; google_ad_width = 468; google_ad_height = 60;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p style="text-align: justify;"><span style="color: #008000;">Was this post helpful to you? How can I improve? &#8211; </span><span style="color: #008000;">Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/timestamp-columns/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use (escape) single quotation mark in sql statements</title>
		<link>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql</link>
		<comments>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql#comments</comments>
		<pubDate>Thu, 06 Oct 2011 16:01:47 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[apostrophe]]></category>
		<category><![CDATA[escape apostrophe]]></category>
		<category><![CDATA[escape single quotation]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=523</guid>
		<description><![CDATA[06-10-2011 We all get that day when we get an exception complaining about the single quotation or apostrophe that was<a href="http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">06-10-2011</span><br />
<script type="text/javascript">// <![CDATA[
   google_ad_client = "ca-pub-5478118713208336"; /* LeadIn */ google_ad_slot = "2638602320"; google_ad_width = 468; google_ad_height = 15;
// ]]&gt;</script><br />
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">// <![CDATA[</p>
<p>// ]]&gt;</script></p>
<p>We all get that day when we get an exception complaining about the single quotation or apostrophe that was in our SQL statement.</p>
<p>The best advisable thing to do is to use stored procedures so that all data are passed as parameters. However there are situations we have to use in-line SQL statements and even there are situations where even SQL parameters cannot manage this issue.</p>
<p>For example, if you use the exec method in you stored procedure body to do some dynamic stuff [read more about using exec to generate dynamic queries in stored procedures <a title="A stored procedure that can auto-genarate SQL queries using exec method" href="http://www.ilearnttoday.com/dynamic-stored-procedure">here</a> ] you will have noticed that even if you pass a string with an apostrophe to an sql parameter it will still throw an exception at you !</p>
<p>So the only way out is to escape this character. Once you instruct the SQL parser to escape the character it will take the apostrophe as part of the string input not part of the command.</p>
<p>How to?</p>
<p>Simply replace your apostrophe / single quotation with two apostrophes / two single quotations .</p>
<p>i.e.<br />
Replace <span style="color: #3366ff;">Bob&#8217;s world</span> With <span style="color: #339966;">Bob&#8217;<span style="color: #ff0000;">&#8216;</span>s world</span>  &lt;- these are two single quotation characters (not one double quotation character)</p>
<p>This can be easily done by using the <span style="color: #008000;">string.replace</span> method.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/how-to-escape-single-quotation-mark-in-sql/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A stored procedure that can auto-genarate SQL queries using exec method</title>
		<link>http://www.ilearnttoday.com/dynamic-stored-procedure</link>
		<comments>http://www.ilearnttoday.com/dynamic-stored-procedure#comments</comments>
		<pubDate>Thu, 06 Oct 2011 13:11:45 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[exec]]></category>
		<category><![CDATA[execute]]></category>
		<category><![CDATA[flexible dynamic stored procedure]]></category>
		<category><![CDATA[parameterize]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=513</guid>
		<description><![CDATA[06-10-2011 Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send the table<a href="http://www.ilearnttoday.com/dynamic-stored-procedure" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">06-10-2011</span><br />
<script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send the table name as a parameter?</p>
<p>Have you ever wanted to write a flexible and dynamic stored procedure that would allow you to send only the condition but also the column name you want to include in the where clause?</p>
<p>Well I did. I wanted to create a stored procedure that would take Table name, Criteria column name  and the Target criteria value as parameters and create the SQL query dynamically.</p>
<p>Usually, we have to write our SQL code in the stored procedure body where we cannot treat our sql statement as a string.</p>
<p>The way to achieve this, however, is by using the Exec method provided in SQL.</p>
<p>Exec (execute) allows you to execute a command or a character string that contains Transact-SQL command(s).</p>
<p>Without wasting more time, following is the code I used to achieve my goal:</p>
<pre class="brush: sql; title: ; notranslate">
CREATE PROCEDURE GetRowCountByStringColumn

@TableName nvarchar(50),
@CriteriaColumnName nvarchar(50),
@CriteriaValue nvarchar(150)
AS
BEGIN

EXEC('SELECT  Count(*) FROM ' + @TableName
+ ' WHERE ' + @CriteriaColumnName + ' = ''' + @CriteriaValue + '''')

END
GO
</pre>
<p>As you can see the procedure takes three arguments:</p>
<p>TableName<br />
CriteriaColumnName &#8211; the name of the column that should be checked in the where clause<br />
CriteriaValue &#8211; the value the Criteria Column Name should be checked against</p>
<p>The exec command creates the SQL command (at run time) and executes it.</p>
<p>This helped me to create many dynamic stored procedures for my current project and saved me from having to create stored procedures for each table.</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/dynamic-stored-procedure/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to auto save the data table in memory into database?</title>
		<link>http://www.ilearnttoday.com/commandbinder</link>
		<comments>http://www.ilearnttoday.com/commandbinder#comments</comments>
		<pubDate>Tue, 04 Oct 2011 13:27:46 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[C# .Net]]></category>
		<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[Data Access]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Auto update]]></category>
		<category><![CDATA[Command Binder]]></category>
		<category><![CDATA[CommandBinder]]></category>
		<category><![CDATA[Data adaptor]]></category>
		<category><![CDATA[data table]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[synchronize]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=479</guid>
		<description><![CDATA[2010-04-01 We frequently get to fetch data from the database, update them and then write them back to the database. Most of<a href="http://www.ilearnttoday.com/commandbinder" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #c0c0c0;">2010-04-</span><span style="color: #c0c0c0;">01</span></p>
<p><span style="color: #ff0000;"> <script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></span></p>
<p>We frequently get to fetch data from the database, update them and then write them back to the database.</p>
<p>Most of the time we only have to write them back as individual records.</p>
<p>How about updating a whole database table in the memory and having to synchronize all changes to the actual data table?</p>
<p>My initial thought was this would be full of complex coding. However, thanks to Microsoft, there&#8217;s nothing much to be done at all.</p>
<p>So how are we gonna do this is&#8230;</p>
<p>We will use a data adaptor to fill our data table as usual.</p>
<p>The only new thing is the use of a Command Binder.</p>
<p>Command Binder: A command binder is capable to detect changes that have occurred to a table (in the memory) and then automatically generate appropriate SQL statements to save those changes into the actual data table (in the database).</p>
<p>Following is a simple example: Scenario: In my application I had to take a database table name and present data in a data grid and then save all changes made by the user.</p>
<p>What we need: a data table an adaptor a connection a command builder I have defined them at the form level so I can use them across the form from different events.</p>
<pre class="brush: csharp; title: ; notranslate">
private DataTable _tbl;

private SqlDataAdapter _adptr;

private SqlConnection _conn;

private SqlCommandBuilder _cbldr;
</pre>
<p>Step1: Initialize connection and retrieve data from the database</p>
<pre class="brush: csharp; title: ; notranslate">
_tbl = new DataTable();
_conn = FetchData.GetOpenConnection();
_adptr = new SqlDataAdapter(&quot;Select * from &quot; + DatabaseTableName, _conn);
_cbldr = new SqlCommandBuilder(_adptr);
_adptr.Fill(_tbl);
</pre>
<p>Step2: Let the user to change data (in here simply bind the table to a grid)</p>
<pre class="brush: csharp; title: ; notranslate">
dgMainGrid.DataSource = _tbl;
</pre>
<p>Step3: Save (synchronize) changes to the actual database table Even though this is a complex process and undoubtedly would take a lot of effort to do manually, Thanks to .net framework all we need is a line of code.</p>
<pre class="brush: csharp; title: ; notranslate">
_adptr.Update(_tbl);
</pre>
<p>Once you call the adaptor to update the table, it will use the command builder attached to it to generate all necessary SQL command building. The database table is now up-to-date!</p>
<p><span style="color: #008000;">Was this post helpful to you? How can I improve? – Your comment is highly appreciated!</span></p>
<p><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/commandbinder/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple JavaScript To Get English Language Definition From A Dictionary</title>
		<link>http://www.ilearnttoday.com/a-simple-javascript-to-get-english-language-definition-from-a-dictionary</link>
		<comments>http://www.ilearnttoday.com/a-simple-javascript-to-get-english-language-definition-from-a-dictionary#comments</comments>
		<pubDate>Tue, 19 May 2009 17:56:31 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Dictionary]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[javascript:(function(){varword=prompt(Enter Word:);if(word!=null){window.open(http://dictionary.reference.com/browse/+word);}})();]]></category>
		<category><![CDATA[Simple Dictionary]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=414</guid>
		<description><![CDATA[2009-05-19 English is not my first language so I use online dictionaries frequently as a part of my daily routine<a href="http://www.ilearnttoday.com/a-simple-javascript-to-get-english-language-definition-from-a-dictionary" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><span style="color: #c0c0c0;">2009-05-19</span></p>
<p class="MsoNormal" style="text-align: justify;">English is not my first language so I use online dictionaries frequently as a part of my daily routine to clarify and learn unfamiliar words as I read through articles in the Internet.</p>
<p class="MsoNormal" style="text-align: justify;">I have been using www.ditionary.com for a long time and I had the plan to make this work easy by creating a small application to retrieve the definition with support of a web service. This morning suddenly a new idea hit me to use JavaScript to get the word in the first place and load the appropriate URL.</p>
<p class="MsoNormal" style="text-align: justify;"><strong> How Does This Work?</strong></p>
<p class="MsoNormal" style="text-align: justify;">When a user enters a word in the www.dictionary.com interface it redirects the user to the following dynamic URL.</p>
<p class="MsoNormal" style="text-align: justify;"><strong>http://dictionary.reference.com/browse/</strong><strong><em>Target-Word</em></strong></p>
<p class="MsoNormal" style="text-align: justify;"><em><strong>Target-Word</strong></em> is The word we are seeking the definition for</p>
<p class="MsoNormal" style="text-align: justify;">What this JavaScript does is it retrieves the desired word from the user via a prompt, generate the appropriate URL according to the above format and open the new URL in a new window or tab so the time taken (under normal circumstance) to, load the web site, type-in the word, wait till the site redirects you, is saved. Now time is only taken for a single server request/response.</p>
<p class="MsoNormal" style="text-align: justify;"><strong> How To Set This Up?</strong></p>
<p class="MsoNormal" style="text-align: justify;">It’s simple, just <span style="font-size: 10pt; font-family: Arial;">add a new favorite (for IE) or bookmark (for FireFox) in your browser and paste following code as the URL (for IE) or Location (for FireFox):</span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><em><span style="font-size: 10pt; font-family: Verdana;">javascript:(function(){var%20word=prompt(%22Enter Word:%22);if(word!=null){window.open(%22http://dictionary.reference.com/browse/%22+word);}})();</span></em></strong></p>
<div id="attachment_529" class="wp-caption alignleft" style="width: 310px"><a href="http://www.ilearnttoday.com/a-simple-javascript-to-get-english-language-definition-from-a-dictionary/addbookmark-fox" rel="attachment wp-att-529"><img class="size-medium wp-image-529" title="Add bookmark dialog box in firefox" src="http://www.ilearnttoday.com/wp-content/uploads/2009/05/AddBookmark-Fox-300x224.png" alt="Add bookmark dialog box in firefox" width="300" height="224" /></a><p class="wp-caption-text">Add bookmark dialog box in firefox</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10pt; font-family: Arial;">Now, when you open the favorite/bookmark, it will ask you for the word you want to look for and open the definition in a new window/tab.</span></span></p>
<p>&nbsp;</p>
<div id="attachment_530" class="wp-caption alignleft" style="width: 310px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2009/05/dic-input.png"><img class="size-medium wp-image-530" title="Sample use of the script" src="http://www.ilearnttoday.com/wp-content/uploads/2009/05/dic-input-300x97.png" alt="Sample use of the script" width="300" height="97" /></a><p class="wp-caption-text">Sample use of the script</p></div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-family: Arial; font-size: x-small;"><span style="font-size: 10pt; font-family: Arial;">It’s easier to use if you add the bookmark/favorite as a button into your bookmark/links toolbar</span></span></p>
<p class="MsoNormal">
<div id="attachment_531" class="wp-caption alignleft" style="width: 100px"><a href="http://www.ilearnttoday.com/wp-content/uploads/2009/05/Button.png"><img class="size-full wp-image-531" title="Bookmark button" src="http://www.ilearnttoday.com/wp-content/uploads/2009/05/Button.png" alt="Bookmark button" width="90" height="39" /></a><p class="wp-caption-text">Bookmark button</p></div>
<p class="MsoNormal"><span style="font-family: Arial; font-size: x-small;"><span style="font-family: Arial; font-size: 10pt;"><br />
</span></span></p>
<p style="text-align: justify;">
<p style="text-align: justify;">This small script helps me a lot daily so I hope this would help you too!</p>
<p style="text-align: justify;"><span style="color: #008000;">Was this post helpful to you? How can I improve? &#8211; </span><span style="color: #008000;">Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
<p class="MsoNormal" style="text-align: justify;">
<input id="gwProxy" type="hidden" /><!--Session data--><br />
<input id="jsProxy" onclick="jsCall();" type="hidden" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/a-simple-javascript-to-get-english-language-definition-from-a-dictionary/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>D LINQ : How to Map Columns Which Auto Generate Values At the Database</title>
		<link>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database</link>
		<comments>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database#comments</comments>
		<pubDate>Mon, 11 May 2009 17:37:17 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[.NET exception]]></category>
		<category><![CDATA[annotation]]></category>
		<category><![CDATA[auto-generate]]></category>
		<category><![CDATA[Cannot insert explicit value for identity column in table 'tbl_Process' when IDENTITY_INSERT is set to OFF]]></category>
		<category><![CDATA[DLINQ]]></category>
		<category><![CDATA[IDENTITY_INSERT]]></category>
		<category><![CDATA[IsDbGenerated]]></category>
		<category><![CDATA[IsDbGenerated:=True]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[primary key]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server exception]]></category>
		<category><![CDATA[Windows Application]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=390</guid>
		<description><![CDATA[2009-05-11 I have being working on a software application made on .Net and recently my client asked me to use<a href="http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><!--[endif]--><span style="color: silver;">2009-05-11</span></p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align: justify;">I have being working on a software application made on .Net and recently my client asked me to use D LINQ instead of SQL.</p>
<p style="text-align: justify;">D LINQ has great benefits loaded! As I started working with DLINQ I started to know that preventing SQL injection is not a headache anymore and misspelled SQL queries will not trouble agian at run time because DLINQ generates all necessary SQL inside the framework!</p>
<p style="text-align: justify;">I chose to use annotations inside the class instead of using separate xml file. Following is a part of the first class I ported to D LINQ.</p>
<p style="text-align: justify;">
<pre class="brush: vb; title: ; notranslate">&lt;/p&gt;
_
Public Class Process
_
Public ProcessID As Integer
_
Public BusinessProcessID As String
_
Public ProcessText As String
...
...
</pre>
<p style="text-align: justify;">ProcessID column is the primary key of my database table tbl_Process.</p>
<p style="text-align: justify;">Important Point: I use database to auto-generate values for the primary key column (integer value incremented by one).</p>
<p style="text-align: justify;">So when I run the application, It gave me this unexpected error:</p>
<p style="text-align: justify;"><strong><em>Cannot insert explicit value for identity column in table &#8216;tbl_Process&#8217; when IDENTITY_INSERT is set to OFF.</em></strong></p>
<p style="text-align: justify;">Basically, the <strong><em>IDENTITY_INSERT</em></strong> when using the database to auto generate value for a field but when I ran a SQL insert statement at the database end it worked fine!</p>
<p style="text-align: justify;">After some tough time I found out the solution for this problem!</p>
<p style="text-align: justify;">When we use an auto-generate field in a data table we have to specifically mention it in the matching field in the appropriate class.</p>
<p style="text-align: justify;">The code to state this is:</p>
<p style="text-align: justify;"><em>Syntax:</em></p>
<p style="text-align: justify;"><strong><em>IsDbGenerated:=True</em></strong></p>
<p style="text-align: justify;">This has to be added to the annotation added for the specific column like:</p>
<p style="text-align: justify;">
<pre class="brush: vb; title: ; notranslate">&lt;/p&gt;
_
Public ProcessID As Integer
</pre>
<p style="text-align: justify;">Now D LINQ can understand that the field value is auto-generated by the database!</p>
<p style="text-align: justify;"><span style="color: green;">Was this post helpful to you? How can I improve? &#8211; Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: silver;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/d-linq-how-to-map-columns-which-auto-generate-values-at-the-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Six Advices to Succeed in Online Paid Surveys</title>
		<link>http://www.ilearnttoday.com/six-advices-to-succeed-in-online-paid-surveys</link>
		<comments>http://www.ilearnttoday.com/six-advices-to-succeed-in-online-paid-surveys#comments</comments>
		<pubDate>Sat, 14 Mar 2009 18:30:59 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Earn Online]]></category>
		<category><![CDATA[Finance]]></category>
		<category><![CDATA[Information Technology]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA[Money]]></category>
		<category><![CDATA[Online Paid Surveys]]></category>
		<category><![CDATA[Surveys]]></category>
		<category><![CDATA[Add new tag]]></category>
		<category><![CDATA[advice]]></category>
		<category><![CDATA[affiliate marketing]]></category>
		<category><![CDATA[bank account]]></category>
		<category><![CDATA[be your own boss]]></category>
		<category><![CDATA[boost survey income]]></category>
		<category><![CDATA[cash]]></category>
		<category><![CDATA[coupon codes]]></category>
		<category><![CDATA[Don't Go After Fortunes]]></category>
		<category><![CDATA[don't lose your money]]></category>
		<category><![CDATA[earn]]></category>
		<category><![CDATA[earn by online surveys]]></category>
		<category><![CDATA[earn survey money]]></category>
		<category><![CDATA[earnings]]></category>
		<category><![CDATA[how to boost income]]></category>
		<category><![CDATA[how to earn money online]]></category>
		<category><![CDATA[how to Select Survey Sites]]></category>
		<category><![CDATA[Internet money]]></category>
		<category><![CDATA[lose money]]></category>
		<category><![CDATA[millions of people]]></category>
		<category><![CDATA[online surveys]]></category>
		<category><![CDATA[Paid]]></category>
		<category><![CDATA[paid surveys]]></category>
		<category><![CDATA[payment limitations]]></category>
		<category><![CDATA[payment options]]></category>
		<category><![CDATA[Paypal]]></category>
		<category><![CDATA[secrets of online surveys]]></category>
		<category><![CDATA[Select Survey Sites]]></category>
		<category><![CDATA[Six Advices to Succeed in Online Paid Surveys]]></category>
		<category><![CDATA[survey]]></category>
		<category><![CDATA[surveying]]></category>
		<category><![CDATA[well paid survey sites]]></category>
		<category><![CDATA[What Do I Get For Responding To Surveys]]></category>

		<guid isPermaLink="false">http://www.ilearnttoday.com/?p=372</guid>
		<description><![CDATA[2009-03-14 I have been working with many survey sites in the Internet and I have learnt a lot of lessons.<a href="http://www.ilearnttoday.com/six-advices-to-succeed-in-online-paid-surveys" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;"><span style="color: silver;">2009-03-14</span></p>
<p style="text-align: justify;">I have been working with many survey sites in the Internet and I have learnt a lot of lessons. I learnt some of these when I was researching about online survey sites and most of these lessons are learnt by experience. So I thought to share my knowledge with the rest of the world hoping it would help someone out there.</p>
<p>So in this article, I will give a set of advices that I have learnt in the hard way&#8230;</p>
<p style="text-align: left;"><strong>Rule 1 &#8211; Don&#8217;t Select Survey Sites From Lists Rated By Other People</strong></p>
<p style="text-align: justify;">Many people in the Internet are involved in <strong>affiliate </strong>marketing. Many surveying sites pay bloggers when they refer a new person to their site. So don&#8217;t believe in those lists such as &#8220;Top 10 Most Paid Survey Sites&#8221;, &#8220;Top 5 Survey Companies&#8221;, etc. because the TOP site of those lists is the site that pays the blogger most! So my advice is not to believe in those ranked lists.</p>
<p style="text-align: left;"><strong>Rule 2 &#8211; Ask the site this question: &#8221; What Do I Get For Responding To Surveys? &#8220;</strong></p>
<p style="text-align: justify;">The answer depends on the site you are going to work with. Some sites pay money and some sites pay by other means such as coupon codes and sweepstakes entries while some sites are charity sites where you get non-paid public service surveys.</p>
<p style="text-align: left;"><strong>Rule 3 &#8211; Work </strong><strong>Only </strong><strong>For Cash</strong></p>
<p style="text-align: justify;">As I mentioned there are many sites which pays you in indirect methods such as coupon codes. My advice is never work on surveys unless they pay you by money because there is no way to measure the value of your work. They will give you a coupon code or sweepstakes entry at the end of your days work and you still have to go around the corner to get your own earnings. Since most of the times these are given as discounts, you have to spend more money and buy something to apply those discounts. In simple words, you only feel you earn but you never get your earnings into your hands.</p>
<p style="text-align: justify;">The worst problem is some coupon codes may not be useful for you at the moment and some discounts may not be available in your region. You have to take this very seriously if you are not living in the same country or region as the origin of the site where it is operational.</p>
<p style="text-align: left;"><strong>Rule 4 &#8211; Check Available Payment Methods</strong></p>
<p style="text-align: justify;">Your computer may simply get surveys through the site without any problems or delays but it doesn&#8217;t mean your payment gets to your bank account in the same speed. Go and check the payment options supported by the site. Some sites support various payment methods while some sites only have one or two methods.</p>
<p style="text-align: justify;">For most payment methods there are limitations across countries. This isn&#8217;t a problem if you are located in the same country where the site is operational but if you are living in a different region or a country you have to be more concerned about this matter.<br />
For an example, you may be able to create a Paypal account from your country but you may not be able to accept payments to that account because Paypal doesn&#8217;t support that service in your country. In such situations if your site does not have suitable options you may lose your money.</p>
<p style="text-align: left;"><strong>Rule 5 &#8211; Don&#8217;t Go After Fortunes</strong></p>
<p style="text-align: justify;">There&#8217;s no such thing as easy money! Remember this as you go on finding for survey sites because you will face sites that say they would pay bulks of money for each survey. My advice according to what I have learnt so far is don&#8217;t go for those sites because the more money they promise, the more chances for that site to be a scam. Unfortunately, many people around the world get into these scams everyday. The best thing is to find a site that pays a reasonable and especially practical price for your work.</p>
<p style="text-align: left;"><strong>Rule 6 &#8211; Work Hard! There&#8217;s No Boss To Push You Forward!</strong></p>
<p style="text-align: justify;">If you are working in a company then you have a boss looking at you to make sure you meet company expectations and to kick you off if you lose performance. In this case, you are your own boss. The good news is there&#8217;s no one to kick you off and you own everything you earn. The bad news is you have to take care of everything. Especially you have to keep your motivation up. It&#8217;s not easy to do something of your own without postponing. You must dedicate yourself to the work at least till you reach a solid level of ground to stand on.</p>
<p style="text-align: justify;">In this new office you don&#8217;t have office times. You have your freedom and at the same time you have all responsibilities on your shoulders. In simple words, It&#8217;s your baby go ahead and grow it!</p>
<p style="text-align: justify;"><strong>Don&#8217;t look for fortunes, Work hard and make your own fortune!</strong></p>
<p style="text-align: justify;"><span style="color: #008000;">Was this post helpful to you? How can I improve? &#8211; </span><span style="color: #008000;">Your comment is highly appreciated!</span></p>
<p style="text-align: justify;"><span style="color: #c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/six-advices-to-succeed-in-online-paid-surveys/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Blood Brain Barrier</title>
		<link>http://www.ilearnttoday.com/the-blood-brain-barrier</link>
		<comments>http://www.ilearnttoday.com/the-blood-brain-barrier#comments</comments>
		<pubDate>Thu, 08 Jan 2009 13:47:14 +0000</pubDate>
		<dc:creator>Menol</dc:creator>
				<category><![CDATA[Health]]></category>
		<category><![CDATA[Living]]></category>
		<category><![CDATA[Menol]]></category>
		<category><![CDATA['end-feet']]></category>
		<category><![CDATA[AIDS]]></category>
		<category><![CDATA[alcohol]]></category>
		<category><![CDATA[amino]]></category>
		<category><![CDATA[amino acid]]></category>
		<category><![CDATA[anesthetics]]></category>
		<category><![CDATA[B-B-B]]></category>
		<category><![CDATA[BBB]]></category>
		<category><![CDATA[blood]]></category>
		<category><![CDATA[blood and brain]]></category>
		<category><![CDATA[Blood Brain Barrier]]></category>
		<category><![CDATA[Blood Brain Barrier Diagram]]></category>
		<category><![CDATA[Blood Brain Barrier illustration]]></category>
		<category><![CDATA[blood capillaries]]></category>
		<category><![CDATA[body defense mechanisms]]></category>
		<category><![CDATA[brain]]></category>
		<category><![CDATA[brain fluid]]></category>
		<category><![CDATA[capillaries]]></category>
		<category><![CDATA[carbon dioxide]]></category>
		<category><![CDATA[Carriers]]></category>
		<category><![CDATA[compounds]]></category>
		<category><![CDATA[compounds of blood]]></category>
		<category><![CDATA[critical organ]]></category>
		<category><![CDATA[efflux pumps]]></category>
		<category><![CDATA[electric signals]]></category>
		<category><![CDATA[fat-soluble]]></category>
		<category><![CDATA[fat-soluble medicine]]></category>
		<category><![CDATA[Glucose]]></category>
		<category><![CDATA[human blood]]></category>
		<category><![CDATA[important orga]]></category>
		<category><![CDATA[ingredients of blood]]></category>
		<category><![CDATA[lipid]]></category>
		<category><![CDATA[manage memory]]></category>
		<category><![CDATA[membranes]]></category>
		<category><![CDATA[molecule]]></category>
		<category><![CDATA[neuron mesh]]></category>
		<category><![CDATA[neurons]]></category>
		<category><![CDATA[operations inside our body]]></category>
		<category><![CDATA[oxygen]]></category>
		<category><![CDATA[Problems of BBB]]></category>
		<category><![CDATA[protect the brain]]></category>
		<category><![CDATA[protecting the brain]]></category>
		<category><![CDATA[protein]]></category>
		<category><![CDATA[protein synthesis]]></category>
		<category><![CDATA[send electric signals]]></category>
		<category><![CDATA[The Blood Brain Barrier]]></category>
		<category><![CDATA[tight junctions]]></category>
		<category><![CDATA[unusual capillaries]]></category>
		<category><![CDATA[volume of the brain]]></category>
		<category><![CDATA[walls of capillaries]]></category>
		<category><![CDATA[water soluble medicine]]></category>
		<category><![CDATA[water soluble substances in the blood]]></category>
		<category><![CDATA[water-soluble]]></category>
		<category><![CDATA[what is blood made of]]></category>
		<category><![CDATA[what is Blood-Brain Barrier made of]]></category>
		<category><![CDATA[Where AIDS virus live]]></category>
		<category><![CDATA[Where is Blood-Brain Barrier Located]]></category>
		<category><![CDATA[‘efflux pumps’]]></category>

		<guid isPermaLink="false">http://ilearnttoday.wordpress.com/?p=283</guid>
		<description><![CDATA[2009-01-08 I wouldn&#8217;t be wrong if I say the Brain is the most vital organ in the human body. As<a href="http://www.ilearnttoday.com/the-blood-brain-barrier" class="searchmore">Read the Rest...</a><div class="clr"></div>]]></description>
			<content:encoded><![CDATA[<p style="text-align:justify;"><span style="color:silver;">2009-01-08</span></p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5478118713208336";
/* LeadIn */
google_ad_slot = "2638602320";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p style="text-align:justify;">I wouldn&#8217;t be wrong if I say the Brain is the most vital organ in the human body. As we all know brain handles most of critical operations inside our body such as keeping and managing memories, organizing our activities, keep other organs perform, and so much more.</p>
<p style="text-align:justify;">The Brain, as most of us already know, works by sending electric signals through complex meshes of neurons so the brain has to maintain a good environment around to keep the accuracy of this electrical signal flow.</p>
<p style="text-align:justify;">The environment inside the brain is the brain fluid so the ingredients or components of the brain fluids are very critical to the functionalities of brain.</p>
<p style="text-align:justify;">Any organ of the body gets the supplies it needs through blood and so does the brain. Ingredients of human blood vary depending on the situation, food, problems of other organs, etc. so it is obvious that the blood is not the same all the time.</p>
<p style="text-align:justify;">Not like other organs, the brain has to think a lot before extracting anything from blood because if the chemical levels of brain fluid vary it directly affects the signals passed through neurons. If the brain fluid is not maintained in an optimum level, the environment will become too noisy for neurons and sending signals would become like talking in the middle of a party.</p>
<p style="text-align:justify;">So there is this Blood-Brain Barrier (which is also referred to as BBB) which extracts the necessary ingredients such as Oxygen and Glucose and make sure nothing else is taken in.</p>
<p style="text-align:justify;"><strong>Blood-Brain Barrier Diagram</strong></p>
<p style="text-align:justify;"><a href="http://ilearnttoday.files.wordpress.com/2009/01/blood-brain-barrier.jpg"><img class="alignnone size-full wp-image-287" title="blood-brain-barrier" src="http://ilearnttoday.files.wordpress.com/2009/01/blood-brain-barrier.jpg" alt="blood-brain-barrier" width="507" height="444" /></a></p>
<p style="text-align:justify;">Photo courtesy:  Malcolm Segal</p>
<p style="text-align:justify;"><strong><br />
Where is Blood-Brain Barrier Located?</strong></p>
<p style="text-align:justify;">BBB is located at the brain blood capillaries. These capillaries are unusual in several aspects from capillaries in other organs. Those aspects are briefly described below:</p>
<ul style="text-align:justify;" type="disc">
<li class="MsoNormal">The end-points of cells which      make up the walls of these capillaries are sealed together at their edges      by tight junctions which are a key component in the barrier. These      junctions make sure that water soluble substances in the blood don&#8217;t pass      between the edges of cells.</li>
<li class="MsoNormal">These capillaries are      enclosed by flattened cells which altogether called the &#8216;end-feet&#8217; which      also work as a (partial and active) barrier.</li>
<li class="MsoNormal">The only way for water      soluble substances in the blood is through the walls of capillaries. These      walls plays the other role in the barrier because their cell membranes are      made up of a lipid/protein belayed only allowing flat-soluble molecules      including those of oxygen and carbon dioxide, anesthetics and alcohol to      pass through the walls of capillaries.</li>
<li class="MsoNormal">In the capillary wall there      are three classes of ‘efflux pumps’ which pumps various lipid-soluble      molecules back in to the blood out of the brain.</li>
</ul>
<p style="text-align:justify;">However, the brain needs water soluble compounds such as Glucose for energy production and amino acids for protein synthesis so there are these <em>Carriers </em>in the walls of capillaries which allow those compounds to go through the wall and move waste products and unwanted molecules in the opposite direction.</p>
<p style="text-align:justify;">The blood-brain barrier plays another key role in keeping the volume of the brain at a constant level. Since the brain is contained inside a rigid skull it is important to keep the fluid from free movement thus keeping volume of the brain static.</p>
<p style="text-align:justify;"><strong>Problems Related to BBB</strong></p>
<p style="text-align:justify;">Even though BBB is made in the sole purpose of protecting the brain, it has become a barrier to medicine to access the brain. Since many medicines are water soluble, they are barricaded at the BBB. This process has made it very hard to treat brain tumors and infections such as AIDS virus.</p>
<p style="text-align:justify;">In fact, AIDS virus uses BBB as a shield by hiding behind the BBB from body defense mechanisms.</p>
<p style="text-align:justify;">Due to such reasons medicine has to be made as fat-soluble but then a new problem arises because then the medicine will be absorbed by most cells of the body which may be toxic.</p>
<p style="text-align:justify;">The alternatives are making drug molecules that can ride on natural transporter proteins or use drugs that can open the Blood-Brain-Barrier.</p>
<p style="text-align:justify;"><span style="color:#008000;">Was this post helpful to you? How can I improve? &#8211; </span><span style="color:#008000;">Your comment is highly appreciated!</span></p>
<p style="text-align:justify;"><span style="color:#c0c0c0;">Cassian Menol Razeek</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ilearnttoday.com/the-blood-brain-barrier/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

