<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7319647383515266191</atom:id><lastBuildDate>Sun, 31 Jul 2011 05:27:22 +0000</lastBuildDate><category>Cool Rendering of a page like animation Effect :) I Love it</category><category>Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted Problem</category><category>Date Formating like  26th..21st or just 1st</category><category>Encrypt and Decrypt a String in C# using Cryptography</category><category>Sending a mail using c#</category><category>Import data from Excel to SQl Server</category><category>SQL: Where clause with group By..</category><category>Error Handling in Asp.Net</category><category>Asp.net</category><category>Show and Hide div using Jquery</category><category>IE8 Problem Solution</category><category>Identify Mobile Browser or Iphone using c# Code</category><category>View State Versus Control State</category><category>Add Favicon to your site (Icon that dispays at the start of the url)</category><category>How to change the Trip Availability Request</category><category>Make an Ajax Get call to a page ...</category><title>OrcasHelper(.Net Reviews)</title><description>Asp.Net, c#, SQL, XML, XSLT, Design Patterns, Ajax.
Navitaire Framework</description><link>http://orcashelper.blogspot.com/</link><managingEditor>noreply@blogger.com (Manoj Kumar Joshi)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/MQMy" /><feedburner:info uri="blogspot/mqmy" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-287324721328779744</guid><pubDate>Sun, 08 May 2011 05:45:00 +0000</pubDate><atom:updated>2011-05-07T23:14:18.175-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Make an Ajax Get call to a page ...</category><title>Make an Ajax Get call to a page ...</title><description>For making an ajax Get call we have to create a page which render's the data expected and here are some code snippets which can be helpful while making a call :&lt;br /&gt;&lt;br /&gt;Create a parameters used to refine search or make an criteria . totally optional&lt;br /&gt; var params = {};&lt;br /&gt;    params = { 'ProductID': productID};&lt;br /&gt;&lt;br /&gt;Now make a call to the page with the params :&lt;br /&gt;&lt;br /&gt; $.get('ProductInfoAjaxPage.aspx', params, function (data) {&lt;br /&gt;        &lt;br /&gt;        // add data to the div&lt;br /&gt;        $("#getData").html(data);&lt;br /&gt;&lt;br /&gt;    }, 'html');&lt;br /&gt;&lt;br /&gt;Here getData is the div inside the page where we are making ajax call and used to display ajax call response html.&lt;br /&gt;&lt;br /&gt;so here you are calling ProductInfoAjaxPage.aspx page and passing a parameter ProductID which &lt;br /&gt;can be used at ProductInfoAjaxPage.aspx page like :&lt;br /&gt;&lt;br /&gt;In class file of ProductInfoAjaxPage.aspx page we can write &lt;br /&gt;&lt;br /&gt;string productID= HttpContext.Current.Request.Params["ProductID"]; and use it for getting some information&lt;br /&gt;related to that product ID&lt;br /&gt;&lt;br /&gt;That's all ,&lt;br /&gt;&lt;br /&gt;Cheers :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-287324721328779744?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/uvyikOMBPXY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/uvyikOMBPXY/make-ajax-get-call-to-page.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2011/05/make-ajax-get-call-to-page.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-6484367141238028875</guid><pubDate>Sun, 08 May 2011 05:41:00 +0000</pubDate><atom:updated>2011-05-07T22:44:59.200-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">How to change the Trip Availability Request</category><title>Navitaire : How to change the Trip Availability Request</title><description>TripAvailabilityRequest availRequest = (TripAvailabilityRequest)this.SessionStore[SessionKey.TripAvailabilityRequest];&lt;br /&gt;foreach (AvailabilityRequest request in availRequest.AvailabilityRequests)&lt;br /&gt;     {&lt;br /&gt;        request.BeginDate = DateTime.Now; //Changed Date&lt;br /&gt;               &lt;br /&gt;         request.EndDate = DateTime.Now; //End date will be the same can change it&lt;br /&gt;      }&lt;br /&gt;&lt;br /&gt;//Save it to the Existing session&lt;br /&gt;this.SessionStore.Remove(SessionKey.TripAvailabilityRequest);&lt;br /&gt;this.SessionStore.Add(SessionKey.TripAvailabilityRequest, availRequest);&lt;br /&gt;&lt;br /&gt;Cheers ,&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-6484367141238028875?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/Xc-cpmLTxU8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/Xc-cpmLTxU8/navitaire-how-to-change-trip.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2011/05/navitaire-how-to-change-trip.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-95693655660934307</guid><pubDate>Sat, 29 Jan 2011 12:51:00 +0000</pubDate><atom:updated>2011-01-29T04:51:37.677-08:00</atom:updated><title>Meredith &amp; Derek - if you have to leave, i wish that you would just leav...</title><description>I love this video..&lt;br /&gt;&lt;br /&gt;&lt;iframe width="425" height="344" src="http://www.youtube.com/embed/QTArBOeY-5o?fs=1" frameborder="0" allowFullScreen=""&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-95693655660934307?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/9ybSJ7Ls6zA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/9ybSJ7Ls6zA/meredith-derek-if-you-have-to-leave-i.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/QTArBOeY-5o/default.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2011/01/meredith-derek-if-you-have-to-leave-i.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-3807989953588903405</guid><pubDate>Wed, 26 Jan 2011 09:54:00 +0000</pubDate><atom:updated>2011-01-26T02:24:24.910-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL: Where clause with group By..</category><title>SQL: Where clause with group By..</title><description>We can use where clause with group by.&lt;br /&gt;&lt;br /&gt;In that case first the where clause will apply to the statement and after filtering it Group by will grouped it. And further if we want to use Having to further filter it we can use.&lt;br /&gt;&lt;br /&gt;here is small snippet for the same :&lt;br /&gt;&lt;br /&gt;Select employee_ID , Max(sale)from Employee_Sale where Sale &gt; 10000 group by employee_ID&lt;br /&gt;&lt;br /&gt;Now the above statement with Having clause :&lt;br /&gt;&lt;br /&gt;Select employee_ID , Max(sale)from Employee_Sale where sale &gt; 10000 group by employee_ID having sum(sale) &gt; 50000&lt;br /&gt;&lt;br /&gt;Cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-3807989953588903405?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/k9Ni4igoNhk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/k9Ni4igoNhk/where-clause-with-group-by.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2011/01/where-clause-with-group-by.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-8795248820496970940</guid><pubDate>Wed, 26 May 2010 16:34:00 +0000</pubDate><atom:updated>2010-05-26T10:27:46.682-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Date Formating like  26th..21st or just 1st</category><title>Date Formating like  26th..21st or just 1st</title><description>Hi,&lt;br /&gt;&lt;br /&gt;A few days before i got a requirement from my client for date formating which is like&lt;br /&gt;"Saturday - 26th June 2010" well it seems to be a small thing but i faced problem when i start changing&lt;br /&gt;date to something like 26th..21st or just 1st...&lt;br /&gt;&lt;br /&gt;After some googling i haven't find any good solution or not any inbuild format for this in C#.&lt;br /&gt;&lt;br /&gt;So i just create a method which takes the date as a parameter and return the required date format.&lt;br /&gt;and here is this method:&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;strong&gt;        /// &lt;summary&gt;&lt;br /&gt;        /// This method accept the Date and convert it to the format like: Sunday - 3rd October 2010&lt;br /&gt;        /// &lt;/summary&gt;&lt;br /&gt;        /// &lt;param name="dateTime"&gt;&lt;/param&gt;&lt;br /&gt;        /// &lt;returns&gt;&lt;/returns&gt;&lt;br /&gt;        private string GetFormatedDate(DateTime dateTime)&lt;br /&gt;        {&lt;br /&gt;&lt;br /&gt;            string dateSuffix = (dateTime.Day.ToString().EndsWith("1"))&lt;br /&gt;                                              ? ((dateTime.Day.ToString().StartsWith("1") &amp;&amp;&lt;br /&gt;                                                  dateTime.Day != 1)&lt;br /&gt;                                                     ? "th"&lt;br /&gt;                                                     : "st")&lt;br /&gt;                                              : (dateTime.Day.ToString().EndsWith("2"))&lt;br /&gt;                                                    ? (dateTime.Day.ToString().StartsWith("1")&lt;br /&gt;                                                           ? "th"&lt;br /&gt;                                                           : "nd")&lt;br /&gt;                                                    : (dateTime.Day.ToString().EndsWith("3"))&lt;br /&gt;                                                          ? (dateTime.Day.ToString().StartsWith("1")&lt;br /&gt;                                                                 ? "th"&lt;br /&gt;                                                                 : "rd")&lt;br /&gt;                                                          : "th";&lt;br /&gt;&lt;br /&gt;            return dateTime.ToString("dddd - d~ MMMM yyyy").Replace("~", dateSuffix);&lt;br /&gt;&lt;br /&gt;        }  &lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;In the above example i used Conditional operator which is something like:&lt;br /&gt;&lt;br /&gt;CheckCondition ? If_True_Then_This_Value : Else_This_Value;&lt;br /&gt;&lt;br /&gt;And at the last line :&lt;br /&gt;&lt;br /&gt;return dateTime.ToString("dddd - d~ MMMM yyyy").Replace("~", dateSuffix);&lt;br /&gt;&lt;br /&gt;i just suffix a character '~', it can be anything but not the part of any date format and replaced it with the date suffix (ie. th, st, rd or nd).&lt;br /&gt;&lt;br /&gt;Hope this will help you guys when you try to do the same.&lt;br /&gt;&lt;br /&gt;Cheers.....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-8795248820496970940?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/csPAZ3JENy8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/csPAZ3JENy8/hi-few-days-before-i-got-requirement_26.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2010/05/hi-few-days-before-i-got-requirement_26.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-2096793258154085654</guid><pubDate>Sun, 16 May 2010 16:03:00 +0000</pubDate><atom:updated>2010-05-16T09:15:21.078-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Show and Hide div using Jquery</category><title>Show and Hide div using Jquery</title><description>Hey with just a simple line of code you can show and hide a div...&lt;br /&gt;&lt;br /&gt;Before Jquery we write our code something like :&lt;br /&gt;&lt;br /&gt;For hiding a div : document.getElementById(id).style.display = 'none';&lt;br /&gt;For Showing a div: document.getElementById(id).style.display = 'block';&lt;br /&gt;  &lt;br /&gt;and now with the cool feature of JQuery :&lt;br /&gt;&lt;br /&gt; For hiding a div :     $("#divResult").hide();&lt;br /&gt; For Showing a div:      $("#divResult").show();&lt;br /&gt;&lt;br /&gt;And also we can play around with this &lt;br /&gt;like &lt;br /&gt;&lt;br /&gt; $("#divResult").show(2000);&lt;br /&gt;&lt;br /&gt;It will slowly display the div in 2 seconds.....&lt;br /&gt;&lt;br /&gt;And for hiding&lt;br /&gt; &lt;br /&gt;$("#divResult").hide("slow");&lt;br /&gt;&lt;br /&gt;Its hides your div slowly..&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-2096793258154085654?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/GY67f9jTSRA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/GY67f9jTSRA/show-and-hide-div-using-jquery.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2010/05/show-and-hide-div-using-jquery.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-2318125016020835821</guid><pubDate>Thu, 04 Mar 2010 16:33:00 +0000</pubDate><atom:updated>2010-03-04T08:58:38.076-08:00</atom:updated><title>Lambda Expression in .net Part1</title><description>Lambda Expression new feature introduce in .net 3.0, is an anonymous method without a name and perform several operation in a few line of codes which is great.&lt;br /&gt;&lt;br /&gt;In lambda expression we use the lambda operator =&gt; , Known as "goes to".&lt;br /&gt;&lt;br /&gt;Here is an example of lambda operator&lt;br /&gt;&lt;br /&gt;IList&lt;BookingQueueInfo&gt; quieueList = list of BookingQueueInfo class;&lt;br /&gt;&lt;br /&gt;Now we find all the BookingQueueInfo class which have property QueueEventType as 'ScheduleTimeChange' or as 'ReaccommodationMove'&lt;br /&gt;&lt;br /&gt;Here is the code :&lt;br /&gt;&lt;br /&gt;List&lt;BookingQueueInfo&gt; bqiList =&lt;br /&gt;                        new List&lt;BookingQueueInfo&gt;(quieueList).FindAll(&lt;br /&gt;                            q =&gt;&lt;br /&gt;                            q.QueueEventType == 'ScheduleTimeChange' || q.QueueEventType == 'ReaccommodationMove');&lt;br /&gt;&lt;br /&gt;Please post if you have any query for Lambda Expression.&lt;br /&gt;&lt;br /&gt;Cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-2318125016020835821?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/_G7AM9BQX5g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/_G7AM9BQX5g/lambda-expression-in-net-part1.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2010/03/lambda-expression-in-net-part1.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-2455436280046794956</guid><pubDate>Sun, 05 Jul 2009 16:41:00 +0000</pubDate><atom:updated>2009-07-05T10:52:03.686-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Encrypt and Decrypt a String in C# using Cryptography</category><title>Encrypt and Decrypt a String in C# using Cryptography</title><description>I am going to explain how to encrypt and decrypt a string in C# using Cryptography and by generating an MD5 hash from the password.&lt;br /&gt;&lt;br /&gt;First of all we need to add System.Security.Cryptography; namespace in our code, I am going to create a class with two Methods&lt;br /&gt;&lt;br /&gt;1) Encrypter&lt;br /&gt;2) Decrypter&lt;br /&gt;&lt;br /&gt;Encrypter used to encrypt a string and Decrypter used to descrypt the string encrypted by Encrypter.&lt;br /&gt;&lt;br /&gt;Here is this beautiful class. Its a competetely implemented Class, what all you need to do is just Copy and Paste.&lt;br /&gt;&lt;br /&gt; public class EncryptDecrypt&lt;br /&gt;    {&lt;br /&gt;        public EncryptDecrypt()&lt;br /&gt;        {&lt;br /&gt;            //&lt;br /&gt;            // TODO: Add constructor logic here&lt;br /&gt;            //&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public string Encrypter(string strStringToEncrypt)&lt;br /&gt;        {&lt;br /&gt;            string strOriginal, strEncryptedString, password;&lt;br /&gt;            TripleDESCryptoServiceProvider des;&lt;br /&gt;            MD5CryptoServiceProvider hashmd5;&lt;br /&gt;            byte[] pwdhash, buff;&lt;br /&gt;&lt;br /&gt; //create a secret password. the password is used to encrypt and decrypt &lt;br /&gt; //strings. Without the password, the encrypted string cannot be    &lt;br /&gt; //decrypted and is just garbage. You must use the same password to   &lt;br /&gt; //decrypt an encrypted string as the string was originally encrypted with.&lt;br /&gt;    &lt;br /&gt;        password = "manojjoshi";&lt;br /&gt;&lt;br /&gt;    //create a string to encrypt&lt;br /&gt;    //original = "String to encrypt";&lt;br /&gt;&lt;br /&gt;            strOriginal = strStringToEncrypt;&lt;br /&gt;&lt;br /&gt; //generate an MD5 hash from the password.a hash is a one way &lt;br /&gt; //encryption meaning once you generate the hash, you cant derive the &lt;br /&gt; //password back from it.&lt;br /&gt;&lt;br /&gt;            hashmd5 = new MD5CryptoServiceProvider();&lt;br /&gt;            pwdhash = hashmd5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(password));&lt;br /&gt;            hashmd5 = null;&lt;br /&gt;&lt;br /&gt;            //implement DES3 encryption&lt;br /&gt;            des = new TripleDESCryptoServiceProvider();&lt;br /&gt;&lt;br /&gt;            //the key is the secret password hash.&lt;br /&gt;            des.Key = pwdhash;&lt;br /&gt;&lt;br /&gt; //the mode is the block cipher mode which is basically the details of how &lt;br /&gt; //the encryption will work. There are several kinds of ciphers available in &lt;br /&gt; //DES3 and they all have benefits and drawbacks. Here the Electronic &lt;br /&gt; //Codebook cipher is used which means that it encrypt each &lt;br /&gt; //block individually and a given bit of  text is always encrypted exactly the  &lt;br /&gt; // same when the same password is used.&lt;br /&gt;                        &lt;br /&gt;            des.Mode = CipherMode.ECB; //CBC, CFB&lt;br /&gt;            &lt;br /&gt;&lt;br /&gt;  //----- encrypt an un-encrypted string ------------&lt;br /&gt; //the original string, which needs encrypted, must be in byte array    &lt;br /&gt; //form to work with the des3 class. everything will because most encryption &lt;br /&gt; //works at the byte level  so you'll find that the class takes in byte &lt;br /&gt; //arrays and returns byte arrays and you'll be converting &lt;br /&gt; //those arrays to strings.&lt;br /&gt;&lt;br /&gt;            buff = ASCIIEncoding.ASCII.GetBytes(strOriginal);&lt;br /&gt;&lt;br /&gt; //encrypt the byte buffer representation of the original string and base64 &lt;br /&gt; //encode the encrypted string. The reason the encrypted bytes are being    &lt;br /&gt; //base64 encoded as string is the encryption will have created some weird  &lt;br /&gt; //characters in there. Base64 encoding provides a platform independent view&lt;br /&gt; //of the encrypted string and can be sent as a plain text string to wherever.&lt;br /&gt;   &lt;br /&gt;            strEncryptedString = Convert.ToBase64String(&lt;br /&gt;            des.CreateEncryptor().TransformFinalBlock(buff, 0, buff.Length)&lt;br /&gt;                );&lt;br /&gt;&lt;br /&gt;             return strEncryptedString;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;        public string Decrypter(string StrEncryptedString)&lt;br /&gt;        {&lt;br /&gt;            string decrypted, password;&lt;br /&gt;            TripleDESCryptoServiceProvider des;&lt;br /&gt;            MD5CryptoServiceProvider hashmd5;&lt;br /&gt;            byte[] pwdhash, buff;&lt;br /&gt;&lt;br /&gt;            //create a secret password. the password is used to encrypt&lt;br /&gt;            //and decrypt strings. Without the password, the encrypted&lt;br /&gt;            //string cannot be decrypted and is just garbage. You must&lt;br /&gt;            //use the same password to decrypt an encrypted string as the&lt;br /&gt;            //string was originally encrypted with.&lt;br /&gt;            password = "manojjoshi&lt;br /&gt;&lt;br /&gt;            //generate an MD5 hash from the password. &lt;br /&gt;            //a hash is a one way encryption meaning once you generate&lt;br /&gt;            //the hash, you cant derive the password back from it.&lt;br /&gt;            hashmd5 = new MD5CryptoServiceProvider();&lt;br /&gt;            pwdhash = hashmd5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(password));&lt;br /&gt;            hashmd5 = null;&lt;br /&gt;&lt;br /&gt;            //implement DES3 encryption&lt;br /&gt;            des = new TripleDESCryptoServiceProvider();&lt;br /&gt;&lt;br /&gt;            //the key is the secret password hash.&lt;br /&gt;            des.Key = pwdhash;&lt;br /&gt;&lt;br /&gt;            //the mode is the block cipher mode which is basically the&lt;br /&gt;            //details of how the encryption will work. There are several&lt;br /&gt;            //kinds of ciphers available in DES3 and they all have benefits&lt;br /&gt;            //and drawbacks. Here the Electronic Codebook cipher is used&lt;br /&gt;            //which means that a given bit of text is always encrypted&lt;br /&gt;            //exactly the same when the same password is used.&lt;br /&gt;            des.Mode = CipherMode.ECB; //CBC, CFB&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;            //----- decrypt an encrypted string ------------&lt;br /&gt;            //whenever you decrypt a string, you must do everything you&lt;br /&gt;            //did to encrypt the string, but in reverse order. To encrypt,&lt;br /&gt;            //first a normal string was des3 encrypted into a byte array&lt;br /&gt;            //and then base64 encoded for reliable transmission. So, to &lt;br /&gt;            //decrypt this string, first the base64 encoded string must be &lt;br /&gt;            //decoded so that just the encrypted byte array remains.&lt;br /&gt;            buff = Convert.FromBase64String(StrEncryptedString);&lt;br /&gt;&lt;br /&gt;            //decrypt DES 3 encrypted byte buffer and return ASCII string&lt;br /&gt;            decrypted = ASCIIEncoding.ASCII.GetString(&lt;br /&gt;                des.CreateDecryptor().TransformFinalBlock(buff, 0, buff.Length)&lt;br /&gt;                );&lt;br /&gt;&lt;br /&gt;            return decrypted;&lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;And we are done with this. Now play with encryption and decryption Cheers..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-2455436280046794956?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/KK8-l8v-VkY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/KK8-l8v-VkY/encrypt-and-decrypt-string-in-c-using.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/07/encrypt-and-decrypt-string-in-c-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-4746255283053636274</guid><pubDate>Sun, 05 Jul 2009 12:26:00 +0000</pubDate><atom:updated>2009-07-05T05:36:10.652-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sending a mail using c#</category><category domain="http://www.blogger.com/atom/ns#">Asp.net</category><title>How to Send mail through C# using SMTP</title><description>If you need to send mails through your code here is the simple Example in &lt;br /&gt;C#&lt;br /&gt;&lt;br /&gt;1) Add the System.Net.Mail; namespace to your code.&lt;br /&gt;&lt;br /&gt;2) Wirte this code or modify it according to your need.       &lt;br /&gt;&lt;br /&gt;       SmtpClient smtpClient = new SmtpClient();&lt;br /&gt;        MailMessage message = new MailMessage();&lt;br /&gt;        try&lt;br /&gt;        {&lt;br /&gt;            string sHostName = "mail.test.com";&lt;br /&gt;            string strEmailFrom = "Manoj@mailtest.com";&lt;br /&gt;            string sFromName = "Manoj";&lt;br /&gt;            string strToEmail = "manojjoshi@gmail.com";&lt;br /&gt;            string strSubject = "Test Mail From Manoj";&lt;br /&gt;            string strBody = "&lt; table &gt;&lt; tr &gt;&lt; td &gt;This is just a test mail&lt; /td &gt;  &lt;br /&gt;                              &lt; /tr &gt;&lt; /table &gt;";  // Format your massage body here&lt;br /&gt;&lt;br /&gt;            MailAddress fromAddress = new MailAddress(strEmailFrom, sFromName);&lt;br /&gt;&lt;br /&gt;            // You can specify the host name or ipaddress of your server&lt;br /&gt;            // Default in IIS will be localhost in this case it is mail.test.com&lt;br /&gt;            smtpClient.Host = sHostName;&lt;br /&gt;            //Default port will be 25&lt;br /&gt;            smtpClient.Port = 25;&lt;br /&gt;            //From address will be given as a MailAddress Object&lt;br /&gt;            message.From = fromAddress;&lt;br /&gt;            // To address collection of MailAddress&lt;br /&gt;            message.To.Add(strToEmail);&lt;br /&gt;            message.Subject = strSubject;&lt;br /&gt;            string ccMailIDs = "MyCC1@gmail.com";&lt;br /&gt;&lt;br /&gt;            ///this line of code is for adding more Recipients in cc of your mail&lt;br /&gt;          &lt;br /&gt;           message.CC.Add(new MailAddress(ccMailIDs));&lt;br /&gt;           ccMailIDs = "MyCC2@gmail.com";&lt;br /&gt;           message.CC.Add(new MailAddress(ccMailIDs));&lt;br /&gt;           ccMailIDs = "MyCC3@gmail.com";&lt;br /&gt;           message.CC.Add(new MailAddress(ccMailIDs));&lt;br /&gt;           //Body can be Html or text format&lt;br /&gt;           //Specify true if it  is html message&lt;br /&gt;           message.IsBodyHtml = true;&lt;br /&gt;           // Message body content&lt;br /&gt;           message.Body = strBody;&lt;br /&gt;&lt;br /&gt;           // Send SMTP mail&lt;br /&gt;           smtpClient.Send(message);            &lt;br /&gt;           &lt;br /&gt;        }&lt;br /&gt;        catch (Exception ex)&lt;br /&gt;        {&lt;br /&gt;            string s = ex.Message;            &lt;br /&gt;        }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And you are done. Cheers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-4746255283053636274?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/nohvrJG9pVo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/nohvrJG9pVo/how-to-send-mail-through-c-using-smtp.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/07/how-to-send-mail-through-c-using-smtp.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-4794692838976545370</guid><pubDate>Wed, 01 Jul 2009 16:43:00 +0000</pubDate><atom:updated>2009-07-01T09:55:04.665-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">View State Versus Control State</category><title>View State Versus Control State</title><description>View State Versus Control State&lt;br /&gt;&lt;br /&gt;ViewState is a mechanism through which Asp.Net preserve state of the controls during postback and preserve data in hidden fields. Whenever any request goes to the server the whole value that is in hidden fields decrypt using BASE64 encoding and further incrypt after server response. We can set enable viewstate property to false if we dont want viewstate.&lt;br /&gt;&lt;br /&gt; And Control State work in the same manner as ViewState but with a big difference,  we can't disable controlstate.Control state is used for storing a control's essential data  that is needed on postback to enable the control to function even when view state has been disabled.&lt;br /&gt;&lt;br /&gt;Mostly Use the Control State property when you are going to implement Custom Control by overriding the SaveControlState method to save the data in Control State&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Cheers&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-4794692838976545370?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/PY1frocINaE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/PY1frocINaE/view-state-versus-control-state.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/07/view-state-versus-control-state.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-683747485928423939</guid><pubDate>Fri, 05 Jun 2009 05:02:00 +0000</pubDate><atom:updated>2009-06-04T22:11:17.284-07:00</atom:updated><title>Rounding a Number in Javascript</title><description>function roundToWhatever()&lt;br /&gt;&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;  var numberToRound = document.getElementById("idOfTheInputProvider").value&lt;br /&gt;&lt;br /&gt;  var numberToRound = new Number(numberToRound );&lt;br /&gt;&lt;br /&gt;  var result =numberToRound.toFixed(10); &lt;br /&gt;&lt;br /&gt;  document.getElementById("idOfTheInputProvider").value = result ;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-683747485928423939?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/BtOjl7jrkZc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/BtOjl7jrkZc/rounding-number-in-javascript.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/06/rounding-number-in-javascript.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-7364212527260260252</guid><pubDate>Mon, 20 Apr 2009 12:28:00 +0000</pubDate><atom:updated>2009-04-20T05:40:32.629-07:00</atom:updated><title>Boxing and Unboxing</title><description>Whenever we convert an Value type to a Reference type this process is called Boxing and opposite of that is UnBoxing&lt;br /&gt;&lt;br /&gt;for ex : &lt;br /&gt; &lt;br /&gt;class BoxingUnBoxing&lt;br /&gt;{&lt;br /&gt;  static void Main()&lt;br /&gt;  {&lt;br /&gt;   int i = 1;&lt;br /&gt;   object o = i;    // boxing&lt;br /&gt;   int j = (int) o; // unboxing&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In this example we are assigning a value type to a reference type (eg. object o = i) , Object o is of reference type and i is of value type. and after that we assign an reference type to a value type (eg. int j = (int) o)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-7364212527260260252?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/k18qz5SUjbI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/k18qz5SUjbI/boxing-and-unboxing.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>2</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/boxing-and-unboxing.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-6636591182349877089</guid><pubDate>Thu, 16 Apr 2009 10:35:00 +0000</pubDate><atom:updated>2009-07-05T08:19:49.869-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Cool Rendering of a page like animation Effect :) I Love it</category><title>Cool Rendering of a page like animation Effect :) I Love it</title><description>Hi&lt;br /&gt;&lt;br /&gt;   If you dont like the page loading while page is postback and the page refereshes.&lt;br /&gt;Then try it really very nice feature and make your page loading amazing, really i do that with one of my website. And it loads with fabulous effects. No need to write nasty of codes just put that tag on your master page. and see your site :)&lt;br /&gt;&lt;br /&gt;&lt; meta http-equiv="Page-Exit" content="progid:DXImageTransform.Microsoft.Fade(duration=.5)"/&gt;&lt;br /&gt;&lt;br /&gt;Keep Smiling :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-6636591182349877089?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/3Ad_g5VXW7s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/3Ad_g5VXW7s/afraid-with-loading-of-website-pages.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/afraid-with-loading-of-website-pages.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-3636202555268015412</guid><pubDate>Wed, 15 Apr 2009 12:02:00 +0000</pubDate><atom:updated>2009-04-15T05:20:53.938-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Add Favicon to your site (Icon that dispays at the start of the url)</category><title>Add Favicon to your site (Icon that dispays at the start of the url)</title><description>Want to add a beautiful icon at the start point of your URL (Called Favicon). Just add this tag to your master Page in the &lt; head&gt; section and before the &lt; /head&gt; Section :&lt;br /&gt;&lt;br /&gt;&lt; link rel="shortcut icon" type="image/x-icon" href="favicon.ico"&gt;&lt;br /&gt;&lt;br /&gt;and place an icon named favicon.ico on the Root directory. &lt;br /&gt;&lt;br /&gt;When you add this site to add to favorites it will display the icon along with url. For doing that just add the following code also:&lt;br /&gt;&lt;br /&gt;&lt; a href="javascript:window.external.AddFavorite('http://www.test.com', 'Test Site')"&gt;&lt;br /&gt;Click here to add Test Site to your favorites &lt; /a&gt;&lt;br /&gt;&lt;br /&gt;it's a cool Feature..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-3636202555268015412?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/jU3CcaQEkwk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/jU3CcaQEkwk/add-favicon-to-your-site-icon-that.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/add-favicon-to-your-site-icon-that.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-3716198895451755570</guid><pubDate>Wed, 15 Apr 2009 10:54:00 +0000</pubDate><atom:updated>2009-04-15T04:14:58.262-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Error Handling in Asp.Net</category><title>Error Handling in Asp.Net</title><description>Asp.Net provide there way of handling errors. We can handle error at&lt;br /&gt;&lt;em&gt;1) Page Level&lt;br /&gt;2) Application Level &lt;br /&gt;3) Through Web.Confing &lt;/em&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;1) Page Level Error Handling :&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;       We can handle error at page level so that if any error comes under the page scope it will handle through the OnError Method of page, But its only at page level not outside that scope. Whenever we create a web form its class drive from System.Web.UI.Page and that why page object help us to invoke page level error. What we do we override OnError method of the page. Like&lt;br /&gt;&lt;br /&gt;protected override void OnError(EventArgs e)&lt;br /&gt;{&lt;br /&gt;  Exception objException = Server.GetLastError (); // Return Current Exception&lt;br /&gt;&lt;br /&gt;  string errorDescription = &lt;br /&gt;     "Source of Error:" + objException.Source + &lt;br /&gt;     "Message : " + objException.Message +&lt;br /&gt;     "Stack trace: " + objException.StackTrace;&lt;br /&gt;&lt;br /&gt;    Response.Write (errorDescription); // Or you can log the Error or redirect to somewhere else/&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;2) Application Level Error Handling :&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Another approach for error handling is at application level. Whenever any Error comes Application_Error sub called. Its a good place for handling error because no need to write it on every page. It Works something like that: &lt;br /&gt;&lt;br /&gt;void Application_Error(object sender, EventArgs e) &lt;br /&gt;{&lt;br /&gt;   Exception objException = Server.GetLastError (); // Return Current Exception&lt;br /&gt;&lt;br /&gt;  string errorDescription = &lt;br /&gt;     "Source of Error: " + objException.Source + &lt;br /&gt;     "Message : " + objException.Message +&lt;br /&gt;     "Stack trace: " + objException.StackTrace;&lt;br /&gt;&lt;br /&gt; // After that use that Error errorDescription as you want eithr make log or redirect to somewhere else/&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;strong&gt;3) Web.Config Custom Errors&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Third place is Web.Config, it enables us to configure html error pages to be displayed in place of a error stack trace Yellow page(really developer hate this). Through it we can handle error on specific code or we can create a single page for handling all the Error.&lt;br /&gt;&lt;br /&gt;When we create a new website it looks like  &lt;customErrors mode="RemoteOnly" /&gt;&lt;br /&gt;Here  we have mode attribute which can be "On|Off|RemoteOnly"&lt;br /&gt;&lt;br /&gt; "RemoteOnly" options is the default option. Specifies that custom errors are shown only to remote clients, and ASP.NET errors are shown to the local host&lt;br /&gt;"On" option shows custom errors are enabled.&lt;br /&gt;&lt;br /&gt;"Off" Specifies custom errors are disabled.&lt;br /&gt;&lt;br /&gt;We can handle errors based on specific code like that:&lt;br /&gt;&lt;br /&gt; &lt; customErrors mode="On" &gt;&lt;br /&gt; &lt; error statusCode="403" redirect="NoAccess.htm" /&gt;&lt;br /&gt; &lt; error statusCode="404" redirect="FileNotFound.aspx" /&gt;&lt;br /&gt; &lt; error statusCode="500" redirect="GenericErrorPage.htm"/&gt;&lt;br /&gt; &lt;/customErrors&gt;&lt;br /&gt;&lt;br /&gt;or We can use a single page redirect for all the Errors&lt;br /&gt;&lt;br /&gt;&lt; customErrors mode="On" defaultRedirect="ForAllError.htm" /&gt;&lt;br /&gt;&lt;br /&gt;Stay away from Errors now&lt;br /&gt;Keep Happy and Programming:)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-3716198895451755570?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/ElPzdMzdI5k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/ElPzdMzdI5k/asp.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/asp.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-1833350932633901337</guid><pubDate>Tue, 14 Apr 2009 15:09:00 +0000</pubDate><atom:updated>2009-04-14T08:25:11.371-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Identify Mobile Browser or Iphone using c# Code</category><title>Identify Mobile Browser or Iphone using c# Code</title><description>Recently i created a mobile browser compatible website for our existing Website.&lt;br /&gt;So as we already marketed our website well for desktop browser but not for Iphone or other Mobile device so we started doing that. Now what client want that whenever any person open our website on mobile device it will redirect to Iphone compatible website &lt;br /&gt;So what, I Just write these lines of code: &lt;br /&gt;&lt;br /&gt;&lt;strong&gt; if (HttpContext.Current.Request.Browser.IsMobileDevice || HttpContext.Current.Request.UserAgent.ToLower().Contains("iphone"))&lt;br /&gt;        {&lt;br /&gt;            Response.Redirect("http://iphone.anjolee.com");&lt;br /&gt;        }&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;on the above code Line&lt;br /&gt;HttpContext.Current.Request.Browser.IsMobileDevice detects the mobile devices but as our Iphone not detected through that so thats why i add one more line : &lt;br /&gt;HttpContext.Current.Request.UserAgent.ToLower().Contains("iphone")&lt;br /&gt;Which detects the Iphone you can use this one for other mobile device not supported by .NET&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-1833350932633901337?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/7jxEfA_rpgI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/7jxEfA_rpgI/identify-mobile-browser-or-iphone-using.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>1</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/identify-mobile-browser-or-iphone-using.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-7511068825898633692</guid><pubDate>Tue, 14 Apr 2009 13:58:00 +0000</pubDate><atom:updated>2009-04-14T07:29:16.026-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Import data from Excel to SQl Server</category><title>Import data from Excel to SQl Server</title><description>Facing problem while importing table data from Excel to Sql Server. &lt;br /&gt;Some time we have some fields on Excel which contain data which is not supported by &lt;br /&gt;Sql Server like single qote('). I take it just as a example. So i write a program&lt;br /&gt;in c# which collects data from excel table read it make changes on data if we need and insert it to SQL. Problem is basically&lt;br /&gt; that if we have lakhs of record its not possible to edit them manually and then import to sql.&lt;br /&gt;&lt;br /&gt; public partial class _Default : System.Web.UI.Page&lt;br /&gt;    {&lt;br /&gt;        protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            // Connection String to Excel Workbook&lt;br /&gt;            string excelConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=YourExcelDataSource(like D:\\Detail.xls);Extended Properties=""Excel 8.0;HDR=YES;""";&lt;br /&gt; using (OleDbConnection connection = new OleDbConnection(excelConnectionString))&lt;br /&gt;     {&lt;br /&gt;      OleDbCommand command = new OleDbCommand("Select * FROM [Data$]", connection);&lt;br /&gt;&lt;br /&gt;      connection.Open();&lt;br /&gt;      DataSet ds = new DataSet();&lt;br /&gt;&lt;br /&gt;      OleDbDataAdapter oda = new OleDbDataAdapter(command);&lt;br /&gt;      oda.Fill(ds);&lt;br /&gt;                &lt;br /&gt;     string sqlConnectionString = "Data Source= SqlDataSource; Initial      Catalog=DataBaseName;uid=Userid; Password=pwd";&lt;br /&gt;                &lt;br /&gt;     SqlConnection con = new SqlConnection(sqlConnectionString);&lt;br /&gt;     con.Open();&lt;br /&gt;                   &lt;br /&gt;     for (int c = 0;c &lt; ds.Tables[0].Rows.Count;c++)&lt;br /&gt;         {&lt;br /&gt;         try&lt;br /&gt;          {&lt;br /&gt;              DataRow dro = ds.Tables[0].Rows[c];&lt;br /&gt;&lt;br /&gt;              object[] array = ds.Tables[0].Rows[c].ItemArray; //Break Table to array&lt;br /&gt;&lt;br /&gt;                    string str = "insert into tableName values(";&lt;br /&gt;&lt;br /&gt;                   for (int k = 1; k &lt; array.Length; k++)&lt;br /&gt;                      {&lt;br /&gt;                        if (array[k].ToString().Contains("'"))&lt;br /&gt;                        {&lt;br /&gt;                          array[k] = array[k].ToString().Replace("'", "''");&lt;br /&gt;                        }&lt;br /&gt;&lt;br /&gt;                    str = str+"'"+ array[k] + "',";&lt;br /&gt;                      }&lt;br /&gt;                            &lt;br /&gt;&lt;br /&gt;                   str = str.Substring(0, str.Length - 1);&lt;br /&gt;                   str = str + ")";&lt;br /&gt;                   SqlCommand com = new SqlCommand(str);&lt;br /&gt;                   com.Connection = con;&lt;br /&gt;                   com.ExecuteNonQuery();&lt;br /&gt;          }&lt;br /&gt;           catch(Exception ex)&lt;br /&gt;             {&lt;br /&gt;                continue;&lt;br /&gt;             }&lt;br /&gt;     }&lt;br /&gt;               //}&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-7511068825898633692?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/7EUJ0NLyLsE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/7EUJ0NLyLsE/import-data-from-excel-to-sql-server.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/import-data-from-excel-to-sql-server.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-2772507316740130481</guid><pubDate>Tue, 14 Apr 2009 13:37:00 +0000</pubDate><atom:updated>2009-04-14T07:29:37.750-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted Problem</category><title>Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted Problem</title><description>facing a new problem &lt;br /&gt;&lt;strong&gt; Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;I face this problem long time ago. My websites woriking well at my end in India office and on my client system also. But problem was that it was not working on some system (another office) and they told me that they face some problem (Site through errors) as i use custom error so the error will not display but site was not working. The error we got was&lt;br /&gt;&lt;strong&gt; Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;So i worked on that and got the answer (after googling). Just add it to your webconfig file: -&lt;br /&gt; pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never"  enableViewStateMac="false" /&gt;&lt;br /&gt;&lt;br /&gt;and problem resolved&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-2772507316740130481?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/QwNN3aeHIag" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/QwNN3aeHIag/validation-of-viewstate-mac-failed.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/validation-of-viewstate-mac-failed.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-6374353499060414423</guid><pubDate>Tue, 14 Apr 2009 13:10:00 +0000</pubDate><atom:updated>2009-04-14T06:22:01.547-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IE8 Problem Solution</category><title>IE8 Compatibility Problem</title><description>Hi,&lt;br /&gt;  Have u in trouble due to not working of your site on IE8 (but Working well on IE7). Here is the&lt;br /&gt;solution (I faced in one of my project).&lt;br /&gt;Just add a HTTP-EQUIV meta tag on your master page if you have or place it on your page&lt;br /&gt;     meta equiv="X-UA-Compatible" content="IE=EmulateIE7"/&gt;&lt;br /&gt;   and see your website working on IE8 .&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;Keep Smiling and Programming :)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-6374353499060414423?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/kqMN-rHzyIE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/kqMN-rHzyIE/ie8-compatibility-problem.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/ie8-compatibility-problem.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7319647383515266191.post-1532832470740686843</guid><pubDate>Tue, 14 Apr 2009 12:32:00 +0000</pubDate><atom:updated>2009-04-14T05:33:48.815-07:00</atom:updated><title>Its all about .Net (Share your Knowldge here)</title><description>Hi,&lt;br /&gt;   Share your views, Knowldge and problems here&lt;br /&gt;&lt;br /&gt;Thanks&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7319647383515266191-1532832470740686843?l=orcashelper.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/MQMy/~4/BQ0dw_emnrQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/MQMy/~3/BQ0dw_emnrQ/its-all-about-net-share-your-knowldge.html</link><author>noreply@blogger.com (Manoj Kumar Joshi)</author><thr:total>0</thr:total><feedburner:origLink>http://orcashelper.blogspot.com/2009/04/its-all-about-net-share-your-knowldge.html</feedburner:origLink></item></channel></rss>

