tag:blogger.com,1999:blog-71728389417953747752024-03-14T00:53:00.269+05:30Dotnet Tutorials ,Codings & Examplesgurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.comBlogger54125tag:blogger.com,1999:blog-7172838941795374775.post-16279782635157897252016-04-12T17:34:00.001+05:302016-04-12T17:34:12.428+05:30Jquery masked input control with knockout JS Below is the sample code for phone and date mask with knockout js and jquery masked input<br />
<br />
<br />
<pre style="background: #f0f0f0; border: 1px dashed #cccccc; color: black; font-family: "arial"; font-size: 12px; height: auto; line-height: 20px; overflow: auto; padding: 0px; text-align: left; width: 99%;"><code style="color: black; word-wrap: normal;"> <script src="http://knockoutjs.com/downloads/knockout-3.4.0.js" type="text/jscript"></script>
<script src="https://code.jquery.com/jquery-2.2.2.js" type="text/jscript"></script>
<script src="https://rawgit.com/digitalBush/jquery.maskedinput/1.4.1/dist/jquery.maskedinput.js" type="text/jscript"></script>
PhoneNumber :
<input type="text" id="txtPhoneNumber" data-bind="MaskedInput: WorkPhone, mask: '(999) 999-9999'" />
</br>
</br>
Date :
<input type="text" id="txtDate" data-bind="MaskedInput: Date, mask: '99/99/9999'" />
<script>
var ViewModel = function () {
var self = this;
self.WorkPhone = ko.observable('');
self.Date = ko.observable('');
ko.bindingHandlers.MaskedInput = {
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
ko.bindingHandlers.value.init(element, valueAccessor, allBindings, viewModel, bindingContext);
},
update: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
ko.bindingHandlers.value.update(element, valueAccessor, allBindings, viewModel, bindingContext);
$(element).mask(allBindings.get('mask'));
valueAccessor()($(element).val());
}
};
//uncomment the following line to enable ko.validation for the control, otherwise validation for the control won't work.
//ko.validation.makeBindingHandlerValidatable('MaskedInput');
}
ko.applyBindings(new ViewModel());
</script>
</code></pre>
<br />
gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-72747223709115092792016-04-02T11:31:00.000+05:302016-04-02T11:31:04.984+05:30What is the difference between char, nchar, varchar, and nvarchar in SQL Server?<b>nchar:</b><br />
<br />
1) support unicode characters<br />
2) fixed length variable<br />
3) Maximum length of 4,000 characters. <br />
3) it will reserve storage space for number of size you specify.<br />
<br />
e.g: <b>nchar(10)</b> if you store only 3 characters and it will reserve space for 10 characters and remaining 7 character space will be waste.<br />
<br />
<b>char:</b><br />
<br />
1) does not support unicode character. <br />
2) fixed length variable <br />
3) Maximum length of 8,000 characters. <br />
4) it will reserve storage space for number of size you specify.<br />
<br />
e.g: <b>nchar(10)</b> if you store only 3 characters and it will
reserve space for 10 characters and remaining 7 character space will
be waste.<br />
<br />
<br />
<b>varchar:</b><br />
<br />
1) does not support unicode character.<br />
2) variable length variable<br />
3) varchar(n) - Maximum 8,000 characters and varchar(max) - Maximum 1,073,741,824 characters <br />
4) it will reserve storage space for the data you store.<br />
<br />
e.g: <b>nvarchar(50)</b>
if you store only 25 characters and it will reserve space only for 25
characters and remaining 25 character space will not allocate in
memory.
<br />
<br />
<b>nvarchar:</b><br />
<br />
1) support unicode characters<br />
2) variable length variable<br />
3) nvarchar(n) - Maximum 4,000 characters and nvarchar(max) - 536,870,912 characters<br />
4) it will reserve storage space for the data you store.<br />
<br />
e.g: <b>nvarchar(50)</b> if you store only 25 characters and it will reserve space only for 25 characters and remaining 25 character space will not allocate in memory.
<br />
gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-56918640545425436872012-09-03T17:28:00.000+05:302016-04-02T02:04:28.402+05:30Sort Alphanumeric Grid View Values<h2>
Sort Alphanumeric Grid View Values in Asp.net</h2>
In Asp.net gridview there is no option to sort the alpha numeric values by default. So i Google some sorting Algorithm and finally got the good Article from - <a href="http://www.davekoelle.com/alphanum.html"> http://www.davekoelle.com </a> and i mixed up the algorithm with the gridview it works very well.<br />
<br />
download the working sample example here:<br />
<br />
<br />
<a href="http://dl.dropbox.com/u/48699390/GridviewAlphaNumericSort.rar" target="_blank"><img border="0" src="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcS9eI6_C_q-zFgqaFk1ElA9JBNBJEJNQSYy0KDnaDLfLL3QQ48jPg" /></a> gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com1tag:blogger.com,1999:blog-7172838941795374775.post-60419115731952321852012-04-27T11:57:00.000+05:302012-04-27T11:59:13.454+05:30C# 4.0 language Spefication doc<a href="http://www.google.co.in/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&sqi=2&ved=0CCUQFjAA&url=http%3A%2F%2Fdownload.microsoft.com%2Fdownload%2F7%2FE%2F6%2F7E6A548C-9C20-4C80-B3B8-860FAF20887A%2FCSharp%25204.0%2520Specification.doc&ei=yzuaT9XrL4TzrQfxheyQDg&usg=AFQjCNGqtviSuRSi2lvbIs825lAqiLftpg&sig2=DlzxAFAtfsg6cfr0YYZXJw">Download</a> C# 4.0 language documents from Microsoftgurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-73578087329694168062012-03-07T14:12:00.000+05:302012-03-07T14:12:56.594+05:30Disable Double Click Asp.net Button<h2>
How to Prevent Double click in Asp.net</h2>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
The following snippets will prevent you from the Double click </div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
<br /></div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
<br /></div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
<b>Just use the below line code under page_load event:</b></div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
</div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
<br /></div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
</div>
<table style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;"><tbody>
<tr><td class="number"><code></code></td><td class="content"></td><td class="content"></td><td class="content"><code class="plain">cmdSubmit.Attributes.Add(</code><code class="string">"onclick"</code><code class="plain">, </code><code class="string">"this.disabled=true;"</code> <code class="plain">+ ClientScript.GetPostBackEventReference(cmdSubmit,</code><code class="string">""</code><code class="plain">).ToString());</code><br />
<br />
<code class="plain">note:- </code><code class="plain"><b>cmdSubmit </b>should be Asp.net Button Name</code></td></tr>
</tbody></table>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
<br /></div>
<div style="font-family: "Helvetica Neue",Arial,Helvetica,sans-serif;">
for more information visit the site:
<a href="http://shawpnendu.blogspot.in/2010/02/how-to-disable-multiple-button-click-in.html" target="_blank">http://shawpnendu.blogspot.in/2010/02/how-to-disable-multiple-button-click-in.html</a></div>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com2Chennai, Tamil Nadu, India13.060422 80.24958312.936679000000002 80.0916545 13.184165 80.4075115tag:blogger.com,1999:blog-7172838941795374775.post-65664937135804371632012-01-24T12:36:00.000+05:302012-01-24T12:41:18.153+05:30How to Read all blob list from the Windows Azure Storage Containers<h2>
Read all Blob List Names from the Windows Azure Containers</h2>
<div style="color: black; overflow: auto; width: 99.5%;">
<pre style="margin: 0em;"></pre>
<pre style="margin: 0em;">The Following snippets is used to read all the Blob list details from the azure containers</pre>
<pre style="margin: 0em;">and also we can avoid the transport connection error while reading the huge blob list.</pre>
<pre style="margin: 0em;">by the paging segment concept can able to read large no of blob list...</pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;"> </span></pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> </span></pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> </span><span style="color: green;">///////// Getting Blobs List if it's below than 5000 ///////////</span><span style="color: black;"> </span> </pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> </span></pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> TextWriter</span><span style="color: black;"> tw = <span style="color: blue;">new</span><span style="color: black;"> <span style="color: #2b91af;">StreamWriter</span><span style="color: black;"> (<span style="color: #a31515;">"d:/blob_thumblist.txt"</span><span style="color: black;"> );</span></span></span></span> </pre>
<pre style="margin: 0em;"> <span style="color: blue;">int</span><span style="color: black;"> pagingCount = 1000;</span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudStorageAccount</span><span style="color: black;"> storageAccount = <span style="color: #2b91af;">CloudStorageAccount</span><span style="color: black;"> .Parse(<span style="color: #2b91af;">ConfigurationSettings</span><span style="color: black;"> .AppSettings[<span style="color: #a31515;">"CloudStorage"</span><span style="color: black;"> ].ToString());</span></span></span></span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudBlobClient</span><span style="color: black;"> blobClient = storageAccount.CreateCloudBlobClient();</span></pre>
<pre style="margin: 0em;"> <span style="color: green;">//Get a reference to the container.</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudBlobContainer</span><span style="color: black;"> container = blobClient.GetContainerReference(<span style="color: #a31515;">"ContainerName"</span><span style="color: black;"> );</span></span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">///////// Getting Blobs if's below than 5000 ///////////</span><span style="color: black;"> </span> </pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">//Return blobs using a flat listing.</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">BlobRequestOptions</span><span style="color: black;"> options = <span style="color: blue;">new</span><span style="color: black;"> <span style="color: #2b91af;">BlobRequestOptions</span><span style="color: black;"> ();</span></span></span></pre>
<pre style="margin: 0em;"> options.UseFlatBlobListing = <span style="color: blue;">true</span><span style="color: black;"> ;</span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">////This first operation will return up to 5000 blobs.</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">ResultSegment</span><span style="color: black;"> <<span style="color: #2b91af;">IListBlobItem</span><span style="color: black;"> > resultSegment = container.ListBlobsSegmented(options);</span></span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">foreach</span><span style="color: black;"> (<span style="color: blue;">var</span><span style="color: black;"> blobItem <span style="color: blue;">in</span><span style="color: black;"> resultSegment.Results)</span></span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span> </pre>
<pre style="margin: 0em;"> <span style="color: green;">//writing the blob name into the text file </span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> tw.WriteLine(blobItem.Uri.Segments[2]);</pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> <span style="color: green;">//close the stream</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> tw.Close();</pre>
<pre style="margin: 0em;"> </pre>
</div>
<div style="color: black; overflow: auto; width: 99.5%;">
<pre style="margin: 0em;"> <span style="color: #2b91af;"> </span></pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> </span> <span style="color: green;"> ///////// Getting Blobs List if it's more than 5000 ///////////</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"><span style="color: #2b91af;"> TextWriter</span><span style="color: black;"> tw = <span style="color: blue;">new</span><span style="color: black;"> <span style="color: #2b91af;">StreamWriter</span><span style="color: black;"> (<span style="color: #a31515;">"d:/blob_thumblist.txt"</span><span style="color: black;"> );</span></span></span></span> </pre>
<pre style="margin: 0em;"> <span style="color: blue;">int</span><span style="color: black;"> pagingCount = 1000;</span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudStorageAccount</span><span style="color: black;"> storageAccount = <span style="color: #2b91af;">CloudStorageAccount</span><span style="color: black;"> .Parse(<span style="color: #2b91af;">ConfigurationSettings</span><span style="color: black;"> .AppSettings[<span style="color: #a31515;">"CloudStorage"</span><span style="color: black;"> ].ToString());</span></span></span></span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudBlobClient</span><span style="color: black;"> blobClient = storageAccount.CreateCloudBlobClient();</span></pre>
<pre style="margin: 0em;"> <span style="color: green;">//Get a reference to the container.</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">CloudBlobContainer</span><span style="color: black;"> container = blobClient.GetContainerReference(<span style="color: #a31515;">"ContainerName"</span><span style="color: black;"> );</span></span></pre>
<pre style="margin: 0em;"> <span style="color: green;">///////// Getting Blobs if's more than 5000 ///////////</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">ResultContinuation</span><span style="color: black;"> continuationToken = resultSegment.ContinuationToken;</span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">//Check whether there are more results and list them in pages of 1000.</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">while</span><span style="color: black;"> (continuationToken != <span style="color: blue;">null</span><span style="color: black;"> )</span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> resultSegment = container.ListBlobsSegmented(pagingCount, continuationToken, options);</pre>
<pre style="margin: 0em;"> <span style="color: blue;">foreach</span><span style="color: black;"> (<span style="color: blue;">var</span><span style="color: black;"> blobItem <span style="color: blue;">in</span><span style="color: black;"> resultSegment.Results)</span></span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> <span style="color: green;">//writing the blob name into the text file </span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">Console</span><span style="color: black;"> .WriteLine(blobItem.Uri.Segments[2]); </span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">//getting blob list count per Paging</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: #2b91af;">Console</span><span style="color: black;"> .WriteLine(resultSegment.Results.Count());</span></pre>
<pre style="margin: 0em;"> <span style="color: green;">//Console.ReadLine();</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> continuationToken = resultSegment.ContinuationToken;</pre>
<pre style="margin: 0em;"> <span style="color: green;">//calling next set of blob list</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> resultSegment.GetNext();</pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> </pre>
<pre style="margin: 0em;"> <span style="color: green;">//close the stream</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> tw.Close();</pre>
<pre style="margin: 0em;"> </pre>
</div>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-55240176507855722012-01-06T17:08:00.000+05:302012-01-06T17:08:23.375+05:30How to Check Azure Blob List Exist or Not<h2>
Check Blob List Exist or Not </h2>
use the following snippet to check whether the blob is Exist or not
<br />
<div style="color: black; overflow: auto; width: 99.5%;">
<pre style="margin: 0em;"> <span style="color: blue;"> </span></pre>
<pre style="margin: 0em;"><span style="color: blue;">public</span><span style="color: black;"> <span style="color: blue;">static</span><span style="color: black;"> <span style="color: blue;">bool</span><span style="color: black;"> Exists(<span style="color: blue;">this</span><span style="color: black;"> <span style="color: #2b91af;">CloudBlob</span><span style="color: black;"> blob)</span></span></span></span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">try</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> blob.FetchAttributes();</pre>
<pre style="margin: 0em;"> <span style="color: blue;">return</span><span style="color: black;"> <span style="color: blue;">true</span><span style="color: black;"> ;</span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">catch</span><span style="color: black;"> (<span style="color: #2b91af;">StorageClientException</span><span style="color: black;"> e)</span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">if</span><span style="color: black;"> (e.ErrorCode == <span style="color: #2b91af;">StorageErrorCode</span><span style="color: black;"> .ResourceNotFound)</span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">return</span><span style="color: black;"> <span style="color: blue;">false</span><span style="color: black;"> ;</span></span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">else</span><span style="color: black;"> </span></pre>
<pre style="margin: 0em;"> <span style="color: black;">{</span></pre>
<pre style="margin: 0em;"> <span style="color: blue;">throw</span><span style="color: black;"> ;</span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> <span style="color: black;">}</span></pre>
<pre style="margin: 0em;"> </pre>
</div>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-46460313128557820532011-07-21T13:23:00.001+05:302011-07-21T14:15:51.685+05:30Disable Browser Back Button using csharp<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;"><span style="color: black;">Disable Firefox and IE Back Button in Asp.net</span></span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; margin-left: 31.5pt; margin-right: 0in; margin-top: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: blue; font-family: Consolas; font-size: 9.5pt;">public</span><span style="font-family: Consolas; font-size: 9.5pt;"> <span style="color: blue;">void</span> ClearBrowserCache()</span><span style="font-family: Consolas; font-size: 9.5pt;">{ </span><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">HttpContext</span><span style="font-family: Consolas; font-size: 9.5pt;">.Current.Response.Cache.SetCacheability(<span style="color: #2b91af;">HttpCacheability</span>.NoCache);</span><span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;"> </span></div>
<div class="MsoNormal" style="line-height: normal; margin: 0in 0in 0.0001pt 31.5pt;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;">HttpContext</span><span style="font-family: Consolas; font-size: 9.5pt;">.Current.Response.Cache.SetExpires(<span style="color: #2b91af;">DateTime</span>.Now); <span style="color: #2b91af;">HttpContext</span>.Current.Response.Cache.SetExpires(<span style="color: #2b91af;">DateTime</span>.Now.AddSeconds(-1));</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="color: #2b91af; font-family: Consolas; font-size: 9.5pt;"> HttpContext</span><span style="font-family: Consolas; font-size: 9.5pt;">.Current.Response.Cache.SetNoStore();</span></div>
<div class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0in; mso-layout-grid-align: none; text-autospace: none;">
<span style="font-family: Consolas; font-size: 9.5pt;"> }</span><br />
<br />
<span style="font-family: Consolas; font-size: 9.5pt;">call this method in each and every page load Event.</span><br />
<span style="font-family: Consolas; font-size: 9.5pt;"> </span><br />
<span style="font-family: Consolas; font-size: 9.5pt;">note:This functionality will not work when you call Server.Transfer for page redirection.</span></div>
<br />gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com1tag:blogger.com,1999:blog-7172838941795374775.post-88560579869709534682011-07-04T18:06:00.000+05:302011-07-26T12:46:01.900+05:30The remote certificate is invalid<h2>The remote certificate is invalid according to the validation procedure</h2><br />
you will get this error because of certificates issue while getting the response from the external web service or any other Web Request from the server.<br />
<br />
follow the below snippet to resolve this issue<br />
<br />
<pre class="brush:csharp">using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
protected void Page_Load(object sender, EventArgs e)
{
ServicePointManager.ServerCertificateValidationCallback = RemoteCertificateValidationCB;
Uri uri = new Uri("http://microsoft.com");
if (uri.Scheme == Uri.UriSchemeHttp)
{
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(uri);
request.Method = WebRequestMethods.Http.Get;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string tmp = reader.ReadToEnd();
Response.Write(tmp);
response.Close();
}
}
public static bool RemoteCertificateValidationCB(Object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{
//If it is really important, validate the certificate issuer here.
string resultsTrue = certificate.Issuer.ToString();
//For now, accept any certificate
return true;
}
</pre><br />
<br />
<br />
<g:plusone></g:plusone>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com1tag:blogger.com,1999:blog-7172838941795374775.post-54136510106108520712011-01-05T18:49:00.000+05:302011-01-05T18:49:23.407+05:30Insert single apostrophe in sql server varchar datatype<h2>Single Apostrophe in Sql server</h2>If you are using SQL strings in your database , chances are you have come across problem with strings in SQL statement. One extra apostrophe screws up the SQL string, causing the SQL statement to fail.<br />
<br />
if you insert the following query it throws the error like below<br />
<br />
<span style="color: blue;">insert into</span> emp <span style="color: blue;">values</span>(<strong>'<span style="color: red;">gurucoder</span>'s'</strong>)<br />
<br />
<em><span style="color: red;">Error:</span></em><br />
<br />
<em><span style="color: red;">Msg 102, Level 15, State 1, Line 1</span></em><br />
<em><span style="color: red;"><br />
</span></em><br />
<em><span style="color: red;">Incorrect syntax near 's'.</span></em><br />
<em><span style="color: red;"><br />
</span></em><em><span style="color: red;">Msg 105, Level 15, State 1, Line 1</span></em><em><span style="color: red;"><br />
</span></em><em><span style="color: red;">Unclosed quotation mark after the character string ')</span></em><em><span style="color: red;"><br />
</span></em><em><span style="color: red;">'.</span></em><br />
<br />
<br />
After some googled i found the solution to solve this .putting the double apostrophe in string value<br />
<br />
<span style="color: blue;">insert into</span> emp <span style="color: blue;">values</span>(<strong><span style="color: red;">'</span><span style="color: red;">gurucoder</span><span style="color: red;">''</span><span style="color: red;">s</span><span style="color: red;">'</span></strong>)<br />
<br />
The above query with double apostrophe will insert the values like gurucoder's in database fieldgurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-64982116586288679932011-01-05T16:13:00.000+05:302011-01-05T16:13:21.389+05:30csproj is not installed error<h2>csproj is not installed error Make sure the application for the project type (.csproj) is installed</h2>This error occurs when u attempt to open the old visual studio project in new Version IDE...<br />
there is no need to reset the enviroment settings and unistall the IDE .To solve this error follow the solution<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/_eRRfx6WX62U/TSRKKjtXInI/AAAAAAAAAKQ/Muaw8pzbhvc/s1600/csproj%2Berror.JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_eRRfx6WX62U/TSRKKjtXInI/AAAAAAAAAKQ/Muaw8pzbhvc/s1600/csproj%2Berror.JPG" /></a></div><br />
<br />
<br />
<br />
<b><br />
solution:</b><br />
<br />
Go to Run command type the below :<br />
<br />
<strong>devenv.exe /resetskippkgs</strong><br />
<br />
perhaps i'm faced this error and i used the above solution it perfectly works within a minute...............<strong> </strong>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-51790501479991842362011-01-03T16:36:00.000+05:302011-07-04T15:48:28.581+05:30Fibonacci Numbers<h2>Fibonacci Series:</h2><br />
Fibonacci examples:<br />
<br />
The Fibonacci sequence is named after Leonardo of Pisa, who was known as Fibonacci (a contraction of filius Bonacci, "son of Bonaccio"). <br />
Fibonacci's 1202 book Liber Abaci introduced the sequence to Western European mathematics, although the sequence was independently <br />
described in Indian mathematics and it is disputed which came first.<br />
<br />
<br />
<br />
The sequence of number 1, 1, 2, 3, 5, 8, 13, 21, 34 . . . . each of which sum is the sum of the two previous numbers. <br />
These numbers are also called Fibonacci numbers. The ratio of one Fibonacci to the preceding one is a Convergent of the<br />
continued fraction.The sum of the Fibonacci Sequence can be directly obtained from Pascal's triangle.Fibonacci numbers are<br />
named after Leonardo of Pisa, known as Fibonacci. The Fibonacci numbers are also a Lucas sequence.Fibonacci numbers can be given by,<br />
<br />
Fn = Fn-1 + Fn-2<br />
<br />
where, F1 = F2 = 1<br />
<dl><dd><table class="wikitable" style="text-align: right;"><tbody>
<tr> <td><i>F</i><sub>0</sub>=</td> <td>0</td> <td><i>F</i><sub>1</sub>=</td> <td>1</td> <td><i>F</i><sub>2</sub>=</td> <td>1</td> <td><i>F</i><sub>3</sub>=</td> <td>2</td> <td><i>F</i><sub>4</sub>=</td> <td>3</td> </tr>
<tr> <td><i>F</i><sub>5</sub>=</td> <td>5</td> <td><i>F</i><sub>6</sub>=</td> <td>8</td> <td><i>F</i><sub>7</sub>=</td> <td>13</td> <td><i>F</i><sub>8</sub>=</td> <td>21</td> <td><i>F</i><sub>9</sub>=</td> <td>34</td> </tr>
<tr> <td><i>F</i><sub>10</sub>=</td> <td>55</td> <td><i>F</i><sub>11</sub>=</td> <td>89</td> <td><i>F</i><sub>12</sub>=</td> <td>144</td> <td><i>F</i><sub>13</sub>=</td> <td>233</td> <td><i>F</i><sub>14</sub>=</td> <td>377</td> </tr>
</tbody></table></dd> </dl><br />
source :<b> wikipedia</b><br />
<br />
<br />
csharp / c# program for Fibonacci series recursive example :<br />
<br />
<br />
<div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="color: blue; font-family: "Courier New"; font-size: 10pt;">class</span><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: #2b91af;">Program</span></span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> {</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">static</span> <span style="color: blue;">void</span> Main(<span style="color: blue;">string</span>[] args)</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> {</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: #2b91af;">Program</span> p=<span style="color: blue;">new</span> <span style="color: #2b91af;">Program</span>();</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> </span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: #2b91af;">Console</span>.Write(p.Fib(14));</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: #2b91af;">Console</span>.ReadLine();</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> }</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><br />
</div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">public</span> <span style="color: blue;">int</span> Fib(<span style="color: blue;">int</span> num)</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> {</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">int</span> res;</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">if</span> (num == 1 || num == 0)</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">return</span> num;</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> res = Fib(num - 1) + Fib(num - 2);</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> <span style="color: blue;">return</span> res;</span></div><div class="MsoNormal" style="line-height: normal; margin-bottom: 0.0001pt;"><span style="font-family: "Courier New"; font-size: 10pt;"> }</span></div><div class="MsoNormal"><span style="font-family: "Courier New"; font-size: 10pt; line-height: 115%;"> }</span></div><div class="MsoNormal"><br />
</div><div class="MsoNormal"><br />
</div><b>Output : 377</b><br />
<br />
<br />
<style type="text/css">
table.wikitable {
background: none repeat scroll 0 0 #F9F9F9;
border: 1px solid #AAAAAA;
border-collapse: collapse;
margin: 1em 1em 1em 0;
}
.wikitable th, .wikitable td {
border: 1px solid #AAAAAA;
padding: 0.2em;
}
dd {
line-height: 1.5em;
margin-bottom: 0.1em;
margin-left: 2em;
}
dl {
margin-bottom: 0.5em;
margin-top: 0.2em;
}
table {
background-color: white;
color: black;
font-size: 100%;
}
</style>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-64144468805317566222010-12-29T11:55:00.000+05:302011-07-04T15:49:24.724+05:30Jquery Pad Editor Free Tool<h2>Jquery Pad Editor Software</h2><br />
Jquery pad is a nice editor tool is very useful for novice jquery professionals for learning purpose and run the jquery snippets within the software....<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/_eRRfx6WX62U/TRrmaWMjGnI/AAAAAAAAAKI/phQ8SSgiFgU/s1600/jQueryPad.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="221" src="http://1.bp.blogspot.com/_eRRfx6WX62U/TRrmaWMjGnI/AAAAAAAAAKI/phQ8SSgiFgU/s400/jQueryPad.PNG" width="400" /></a></div><br />
<br />
<br />
<a href="http://www.duckload.com/dl/EUvO2" target="_blank"><br />
<br />
<img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png" /><br />
<br />
</a><br />
<br />
<br />
<br />
Requirements :<br />
<br />
dotnet framework 3.5 sp1 and above<br />
<br />
<br />
tags:JqueryPad,jquery editor,jquery pad,jquery editor tool.gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-75475044776192618682010-12-21T15:03:00.000+05:302010-12-21T15:11:48.199+05:30Generic Method to Populate Dropdown Data in C# | Populate Dropdown from Dataset<a href="http://www.csharptalk.com/2010/03/generic-method-to-populate-dropdown.html">Generic Method to Populate Dropdown Data in C# | Populate Dropdown from Dataset</a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-60754006518471654382010-09-22T19:05:00.000+05:302010-09-22T19:12:28.995+05:30how to insert the multipe records in sql server with xml datawhile inserting multiple records at a same time in a single transaction without failure (eg: bulk booking cinema tickets) means how to do this. for that inserting datas in sql server via xml is better.By using this we can also stop the transaction failure.................<br />
<br />
The following example shows how to insert the multiple records using xml data<br />
<br />
CREATE TABLE [dbo].[empinfo](<br />
[eno] [int] NULL,<br />
[ename] [varchar](50) <br />
) <br />
Stored procedure:<br />
<br />
Create Procedure sp_InsertEmp<br />
<br />
@in_XML Text<br />
AS<br />
Begin<br />
<br />
DECLARE @XMLHandle AS INTEGER <br />
<br />
Declare @temp table<br />
(empno int,<br />
empname varchar(20)<br />
) <br />
----------------------------------------------------------------<br />
-- Initialize the XML for Processing<br />
----------------------------------------------------------------<br />
EXECUTE sp_xml_preparedocument<br />
@XMLHandle OUTPUT<br />
, @in_XML<br />
<br />
INSERT @Temp <br />
(<br />
empno,<br />
empname <br />
)<br />
SELECT <br />
XMLInput.eno,<br />
XMLInput.ename <br />
FROM OPENXML(@XMLHandle,'NewDataset/employee',2)<br />
WITH<br />
(<br />
eno int,<br />
ename varchar(20)<br />
)as XMLInput<br />
<br />
----------------------------------------------------------------<br />
-- Close the XML<br />
----------------------------------------------------------------<br />
EXECUTE sp_xml_removedocument @XmlHandle<br />
<br />
<br />
insert into empinfo(eno,ename)<br />
<br />
select empno,empname from @temp<br />
<br />
End<br />
<br />
<br />
<br />
--execute stored procedure<br />
<br />
exec sp_InsertEmp<br />
<br />
'<NewDataset><br />
<employee><br />
<eno>101</eno><br />
<ename>sidhu</ename><br />
</employee><br />
</NewDataset>'<br />
<br />
<a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fgurucoders.blogspot.com%2f2010%2f09%2fhow-to-insert-multipe-records-in-sql.html"><img alt="kick it on DotNetKicks.com" border="0" src="http%3A%2F%2Fwww.dotnetkicks.com%2FServices%2FImages%2FKickItImageGenerator.ashx%3Furl%3Dhttp%253a%252f%252fgurucoders.blogspot.com%252f2010%252f09%252fhow-to-insert-multipe-records-in-sql.html" /></a><br />
<br />
Related Question :<br />
<br />
1) <a href="http://draft.blogger.com/post-edit.g?blogID=7172838941795374775&postID=6075400651847165438#">how to insert the multiple records using c# and sqlserver</a><br />
2)<a href="http://draft.blogger.com/post-edit.g?blogID=7172838941795374775&postID=6075400651847165438#"> how to To Send Multiple Rows At Once Into A Stored Procedure</a><br />
3) <a href="http://draft.blogger.com/post-edit.g?blogID=7172838941795374775&postID=6075400651847165438#">Work with XML Data Type in SQL Server 2005 from ADO.NET 2.0 </a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-34908566357447456652010-09-04T11:07:00.000+05:302010-09-04T11:07:53.447+05:30How to backup all sql server 2005 databases<h3>Backup all sql server 2005 Database using Script</h3><code><span style="color: blue;">DECLARE </span><span style="color: #434343;">@name </span><span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: black;">50</span><span style="color: grey;">) </span><span style="color: green;">-- database name </span><span style="color: blue;">DECLARE </span><span style="color: #434343;">@path </span><span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: black;">256</span><span style="color: grey;">) </span><span style="color: green;">-- path for backup files </span><span style="color: blue;">DECLARE </span><span style="color: #434343;">@fileName </span><span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: black;">256</span><span style="color: grey;">) </span><span style="color: green;">-- filename for backup </span><span style="color: blue;">DECLARE </span><span style="color: #434343;">@fileDate </span><span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: black;">20</span><span style="color: grey;">) </span><span style="color: green;">-- used for file name <br />
</span><span style="color: blue;">SET </span><span style="color: #434343;">@path </span><span style="color: blue;">= </span><span style="color: red;">'C:\Backup\' <br />
</span><span style="color: blue;">SELECT </span><span style="color: #434343;">@fileDate </span><span style="color: blue;">= </span><span style="color: magenta;">CONVERT</span><span style="color: grey;">(</span><span style="color: blue;">VARCHAR</span><span style="color: grey;">(</span><span style="color: black;">20</span><span style="color: grey;">),</span><span style="color: magenta;">GETDATE</span><span style="color: grey;">(),</span><span style="color: black;">112</span><span style="color: grey;">) <br />
</span><span style="color: blue;">DECLARE </span><span style="color: black;">db_cursor </span><span style="color: blue;">CURSOR FOR <br />
SELECT </span><span style="color: black;">name </span><span style="color: blue;">FROM </span><span style="color: black;">master.dbo.sysdatabases </span><span style="color: blue;">WHERE </span><span style="color: black;">name </span><span style="color: grey;">NOT </span><span style="color: blue;">IN </span><span style="color: grey;">(</span><span style="color: red;">'master'</span><span style="color: grey;">,</span><span style="color: red;">'model'</span><span style="color: grey;">,</span><span style="color: red;">'msdb'</span><span style="color: grey;">,</span><span style="color: red;">'tempdb'</span><span style="color: grey;">) <br />
</span><span style="color: blue;">OPEN </span><span style="color: black;">db_cursor </span><span style="color: blue;">FETCH </span><span style="color: black;">NEXT </span><span style="color: blue;">FROM </span><span style="color: black;">db_cursor </span><span style="color: blue;">INTO </span><span style="color: #434343;">@name <br />
</span><span style="color: blue;">WHILE </span><span style="color: #434343;">@@FETCH_STATUS </span><span style="color: blue;">= </span><span style="color: black;">0 </span><span style="color: blue;">BEGIN <br />
SET </span><span style="color: #434343;">@fileName </span><span style="color: blue;">= </span><span style="color: #434343;">@path </span><span style="color: grey;">+ </span><span style="color: #434343;">@name </span><span style="color: grey;">+ </span><span style="color: red;">'_' </span><span style="color: grey;">+ </span><span style="color: #434343;">@fileDate </span><span style="color: grey;">+ </span><span style="color: red;">'.BAK' <br />
</span><span style="color: blue;">BACKUP DATABASE </span><span style="color: #434343;">@name </span><span style="color: blue;">TO DISK = </span><span style="color: #434343;">@fileName <br />
<br />
</span><span style="color: blue;">FETCH </span><span style="color: black;">NEXT </span><span style="color: blue;">FROM </span><span style="color: black;">db_cursor </span><span style="color: blue;">INTO </span><span style="color: #434343;">@name </span><span style="color: blue;">END </span></code><br />
<code><span style="color: blue;"> <br />
CLOSE </span><span style="color: black;">db_cursor </span><span style="color: blue;">DEALLOCATE </span><span style="color: black;">db_cursor</span></code>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-26728889988322691292010-08-31T11:30:00.000+05:302011-07-04T15:51:59.691+05:30How to validate Numeric Decimal Values using c#Decimal validation mostly used utility in the software application ..........<br />
<br />
The Below sample code is done the numeric validation exactly.it doesn't allow the double dot in numeric values...........<br />
<br />
<br />
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)<br />
{<br />
NumericDecimalValidation(sender,e);<br />
}<br />
<br />
<see cref="System.Windows.Forms.KeyPressEventArgs">public void NumericDecimalValidation(object Sender, KeyPressEventArgs e)<br />
{<br />
<br />
if (char.IsDigit(e.KeyChar) || e.KeyChar.ToString() == "." || char.IsControl(e.KeyChar))<br />
{<br />
if (((TextBox)Sender).Text.IndexOf(".") != -1 && e.KeyChar.ToString() == ".")<br />
e.Handled = true;<br />
else<br />
e.Handled = false;<br />
}<br />
else<br />
e.Handled = true;<br />
}</see>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-14901310280224588442010-04-23T13:37:00.000+05:302010-04-23T13:40:40.190+05:30Creating pagination for asp.net repeater<div class="separator" style="clear: both; text-align: center;"></div><h3>Asp.net Datalist and Repeater Pagination like Digg Style</h3><span style="font-family: verdana; font-size: x-small;"><br />
</span><br />
i have upload the sample pagination application for datalist like digg....<br />
<br />
Customize the css style whatever you want.............<br />
<br />
<br />
<b>sample screenshot</b>:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/_eRRfx6WX62U/S9FSjVtMBII/AAAAAAAAAIE/RQ3uGOCSuFc/s1600/Asp.net_Repeater_pagination.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="http://3.bp.blogspot.com/_eRRfx6WX62U/S9FSjVtMBII/AAAAAAAAAIE/RQ3uGOCSuFc/s320/Asp.net_Repeater_pagination.jpg" width="320" /></a></div><br />
<a href="http://www.easy-share.com/1910006950/numericPaging.rar" target="_blank"><br />
<img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png"><br />
</a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-79336761671253996082010-04-19T23:21:00.000+05:302011-07-04T15:50:39.153+05:30Check user name Availability Using Asp.net and Jquery<h2> How to Check user name Availability Using Asp.net ,Jquery and Json ? </h2><br />
This Application is used to check the user name availability Asynchronously and without affect the page postback . It is done by using the little help of jquery to post the data on Change event to another page.In that page checking the username checking functionality and finally return the confirmation message.<br />
<br />
This functionality id really helpful for user registration page.I provide the sample in a easy manner and i hope this is helpful to your development ...............<br />
<br />
<br />
<a href="http://www.duckload.com/download/1324150/usernameavailability.rar" target="_blank"><img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png" /></a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-91069622443866461622010-04-19T21:58:00.000+05:302011-07-04T15:52:31.904+05:30Find and count the no words using Generic Collections Dictionary<div style="font-family: Arial,Helvetica,sans-serif;"><b>Find the no of word occurences </b></div><br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Threading;<br />
<br />
class CountWords<br />
{<br />
<br />
public void get()<br />
{<br />
string words = "The C# is Very Cool! The Best";<br />
string[] splitWords=words.Split(' ');<br />
<br />
Dictionary<string, int=""> dic = new Dictionary<string, int="">();<br />
<br />
foreach (string str in splitWords)<br />
{<br />
if (dic.ContainsKey(str))<br />
{<br />
dic[str] = dic[str] + 1;<br />
}<br />
else<br />
{<br />
dic.Add(str, 1);<br />
}<br />
}<br />
<br />
foreach (KeyValuePair<string,int> var in dic)<br />
{<br />
Console.WriteLine(var.Key + ":" + var.Value);<br />
}<br />
}<br />
<br />
static void Main()<br />
{<br />
CountWords obj = new CountWords();<br />
obj.get();<br />
Console.ReadLine();<br />
}<br />
}<br />
</string,int></string,></string,>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0Dindigul, Tamil Nadu, India10.158153268244805 77.747497558593759.9891827682448042 77.514038058593755 10.327123768244805 77.980957058593745tag:blogger.com,1999:blog-7172838941795374775.post-35427638771334565222010-04-19T21:06:00.000+05:302011-07-04T15:51:27.893+05:30How to create Autocomplete textbox using Asp.net and Jquery<h2>Auto Complete TextBox Jquery,Json,Asp.net </h2><br />
what is Autocomplete ?<br />
<br />
A feature that suggests text automatically based on the first few characters that a user types<br />
<br />
<br />
I'm googling for autocomplete using Jquery and Asp.net .finally i got a nice article regarding this but the example is provided in php .Then after sometime i migrated the code into Asp.net with Generic handler and with the help of jquery and json .. This will make a asynchronous call to the server side, with no post back<br />
<br />
<br />
<a href="http://www.mediafire.com/file/zjiylwjt2yi/AutocompleteAsp.net+Jquery.rar" target="_blank"><br />
<img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png" /><br />
</a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-28989207199303077032009-12-09T12:57:00.000+05:302011-07-04T15:54:40.919+05:30download crystal reports 2005 merge modulesCrystal Reports uses merge modules to verify the correct crystal report components and assemblies are installed with your deployment project.<br />
<br />
A merge module is a set of components that are merged with a Windows installer for applications that need them. The components may include a .dll file, resources, registry entries, setup logic, and related files. With all related components stored in a single container, the installer eliminates version conflicts and other common installation problems.<br />
<br />
Crystal reports merge modules for deployment<br />
<br />
<ul><li>CrystalReportsRedist2005_x86.msm </li>
<li>Microsoft_VC80_ATL_x86.msm</li>
<li>policy_8_0_Microsoft_VC80_ATL_x86.msm</li>
</ul> <br />
<a href="http://www.mediafire.com/?gnzmoywdnim" target="_blank"><br />
<img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png" /></a><br />
<br />
Tags: crystal reports merge modules,deployment crystal report project problem,crystal report deployment issues,download merge modules for crystal report,crystall report dll files for deploymentgurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com1tag:blogger.com,1999:blog-7172838941795374775.post-49012154262473458032009-10-07T18:16:00.000+05:302011-07-04T15:54:57.371+05:30Detect all ip addresses on the lan networkThis sample application detects the all ip address and domain name on the<br />
LAN network system. <br />
<br />
<a href="http://www.mediafire.com/download.php?dylyymm14mm" target="_blank"><br />
<img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXt%0AvxenwJEY4So5WI_j/download.png" /></a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-73900795653116676092009-09-18T00:48:00.000+05:302011-07-04T15:52:51.313+05:30Free Asp.net UI controlsMetaBuilders WebControls Server Control Library<br />
<br />
Here's the list of controls available <br />
<ul><li><b>AdSense Ads</b> - Controls to show your Google AdSense ads.</li>
<li><b>CheckedListBox</b> - A Listbox with checkboxes for selection</li>
<li><b>ComboBox</b> - The classic type-or-choose control.</li>
<li><b>DataControlFields</b> - Three fields for the GridView, <b>BooleanField</b> for boolean values (better than the CheckBoxField), <b>LookupField</b> for ID/Key data to a child datasource, and <b>SelectorField</b> for row selection using checkboxes or radiobuttons.</li>
<li><b>DialogWindow</b> - A set of controls which make creating dialog windows a lot easier</li>
<li><b>DualList</b> - move items back and forth between two listboxes to select the items</li>
<li><b>DynamicListBox</b> - a base control which stores changes to its list of items</li>
<li><b>ExpandingButtons</b> - hide and show a target control</li>
<li><b>ExpandingPanel</b> - hide and show the content of the panel</li>
<li><b>FileUpload</b> - A nicer wrapper than the builtin for basic file uploading</li>
<li><b>GlobalRadioButton</b> - A radiobutton which has a page-wide, cross-namingcontainer Group property</li>
<li><b>Grouped Lists</b> aka GroupedListBox and GroupedDropDownList enabled support of the html option grouping in extensions of the standard data controls.</li>
<li><b>ListLink</b> - A non-visual control which helps you create parent/child relationships between list controls</li>
<li><b>MultiFileUpload</b> is a nice compact UI that lets the user select more than one file to upload to the server.</li>
<li><b>MultiViewBar</b> is now free and included in the library, source and all.</li>
<li><b>OneClick</b> - non-visual control that helps the page developer avoid the dreaded double-button-click</li>
<li><b>Polling</b> - controls and framework for showing users simple web polls. Uses a provider framework, with built-in providers for Access and Sql Server.</li>
<li><b>ParsingContainer</b> - control which parses a string of server control markup at runtime</li>
<li><b>QueryCall</b> - Component which maps querystring parameters to methods in the codebehind</li>
<li><b>RemoteWindow</b> - Easy popup windows</li>
<li><b>ResizeMonitor</b> - causes a postback on browser-resize, if you need to keep track of dimensions in your app</li>
<li><b>RollOverLink</b> - the old mouse-over-out effect on images, made dead-easy</li>
<li><b>RuntimeTemplate</b> - Makes it easier to create templates for controls at runtime in code</li>
<li><b>UpDown</b> - the classic Windows Up/Down control for numeric entry.</li>
</ul><br />
<a href="http://www.codeplex.com/metabuildersweb/" target="_blank"><img border="0" src="http://tuw6gq.blu.livefilestore.com/y1psgC3H8YPOqPWJ21TstK5eojE159X7bXjdlrTKxSQWI_izYV3C8mKF1Qj2BrPTRaVC01a3hheV0en3hXtvxenwJEY4So5WI_j/download.png" /></a>gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0tag:blogger.com,1999:blog-7172838941795374775.post-83742314603346521562009-09-02T02:09:00.000+05:302011-07-04T15:53:25.711+05:30Programmatically Download File from Remote Location to User Through Serverusing System;<br />
using System.Data;<br />
using System.Configuration;<br />
using System.Web;<br />
using System.Web.Security;<br />
using System.Web.UI;<br />
using System.Web.UI.WebControls;<br />
using System.Web.UI.WebControls.WebParts;<br />
using System.Web.UI.HtmlControls;<br />
using System.Data.SqlClient;<br />
using System.Data.Sql;<br />
using System.Net;<br />
using System.IO;<br />
<br />
public partial class _Default : System.Web.UI.Page<br />
{<br />
protected void Page_Load(object sender, EventArgs e)<br />
{<br />
//base.OnLoad(e);<br />
string url = string.Empty;// Request.QueryString["DownloadUrl"];<br />
if (url == null || url.Length == 0)<br />
{<br />
url = "http://img444.imageshack.us/img444/6228/initialgridsq7.jpg";<br />
}<br />
<br />
//Initialize the input stream<br />
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);<br />
HttpWebResponse resp = (HttpWebResponse)req.GetResponse();<br />
int bufferSize = 1;<br />
<br />
//Initialize the output stream<br />
Response.Clear();<br />
Response.AppendHeader("Content-Disposition:", "attachment; filename=download.jpg");<br />
Response.AppendHeader("Content-Length", resp.ContentLength.ToString());<br />
Response.ContentType = "application/download";<br />
<br />
//Populate the output stream<br />
byte[] ByteBuffer = new byte[bufferSize + 1];<br />
MemoryStream ms = new MemoryStream(ByteBuffer, true);<br />
Stream rs = req.GetResponse().GetResponseStream();<br />
byte[] bytes = new byte[bufferSize + 1];<br />
while (rs.Read(ByteBuffer, 0, ByteBuffer.Length) > 0)<br />
{<br />
Response.BinaryWrite(ms.ToArray());<br />
Response.Flush();<br />
}<br />
<br />
//Cleanup<br />
Response.End();<br />
ms.Close();<br />
ms.Dispose();<br />
rs.Dispose();<br />
ByteBuffer = null;<br />
}<br />
}gurucodershttp://www.blogger.com/profile/01709559011636952900noreply@blogger.com0