tag:blogger.com,1999:blog-10663976582491080062024-02-07T07:44:07.036+05:30Muthukumar NadarThings I like to Share...Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.comBlogger100125tag:blogger.com,1999:blog-1066397658249108006.post-40659998114185322922014-01-30T20:02:00.000+05:302014-01-30T20:03:30.277+05:30Session Value lost on every request<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;">Recently I was facing an issue where my website is working fine
with other browsers but it fails on internet explorer. Getting deeper into that
issue I found like <b>session values are lost</b>
on every request on pages on internet explorer, this is because <b>session id</b> actually getting <b>changes</b> on <b>every request</b> on <b>internet
explorer</b>. <o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span></div>
<span style="line-height: 107%;"><span style="font-family: Trebuchet MS, sans-serif;">Getting into deeper, why it wasn't working is, because
my website's url contained an underscore character (ie http://my_website). I have changed the name and
now it all works fine.</span></span><br />
<span style="font-family: Trebuchet MS, sans-serif;"><br /></span>
<span style="font-family: Trebuchet MS, sans-serif;">Reference: <b>Muthukumar Nadar</b> (http://nadarmuthukumar.blogspot.in) </span><br />
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><a href="http://goog_375830683/" target="_blank">http://www-01.ibm.com/support/docview.wss?uid=swg21112062<o:p></o:p></a></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><a href="http://goog_375830683/" target="_blank">http://www.alexrothenberg.com/2010/09/24/use-dashes-not-underscores-in-your.html<o:p></o:p></a></span></div>
<div class="MsoNormal">
<span style="font-family: Trebuchet MS, sans-serif;"><a href="http://goog_375830683/" target="_blank">http://www.ietf.org/rfc/rfc2396.txt<o:p></o:p></a></span></div>
<a href="http://forums.iis.net/post/1873244.aspx" style="font-family: 'Trebuchet MS', sans-serif;" target="_blank">http://forums.iis.net/post/1873244.aspx</a><br />
<br />
<div class="MsoNormal">
<o:p></o:p></div>
<span style="font-family: Trebuchet MS, sans-serif;">Hope you liked this post, also let me know your thoughts on the post through your valuable comment.
Thank you.</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0tag:blogger.com,1999:blog-1066397658249108006.post-84704230623896691962013-07-13T22:18:00.000+05:302013-07-13T22:24:08.003+05:30lock folder without any software<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "Trebuchet MS",sans-serif;">Open Notepad and copy the below code</span><br />
<span style="font-family: "Trebuchet MS",sans-serif;"> </span>
<br />
<pre class="brush:">cls
@ECHO OFF
title Folder Locker
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Locker goto MDLOCKER
:CONFIRM
echo Are you sure u want to Lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
goto CONFIRM
:LOCK
ren Locker "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
:UNLOCK
echo Enter password to Unlock folder
set/p "pass=>"
if NOT %pass%==type your password here goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Locker
echo Folder Unlocked successfully
goto End
:FAIL
echo Invalid password
goto end
:MDLOCKER
md Locker
echo Locker created successfully
goto End
:End
</pre>
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Find "type your password here" and replace with a password for the folder, now save the notepad as "locker.bat". </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Now double click on "locker.bat", at the first time start it will create folder with name "Locker" automatically for you. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">That's it, you are done. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Now to lock the folder double click on the "locker.bat" file, it will ask you to press "Y" or "N". "Y" is to lock. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">To unlock the folder double click on the "locker.bat" file, it will ask you the password, enter the correct password and the folder will be visible now. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;"><b>Important note:</b>
This technique is not the secure one because anybody can right click and go to the edit option and can see the password. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">So it is recommended that you keep the file somewhere secure. </span><br />
<span style="font-family: "Trebuchet MS",sans-serif;"><b>OR</b> </span><br />
<span style="font-family: "Trebuchet MS",sans-serif;">You can use ".bat" to ".exe" <a href="http://www.f2ko.de/programs.php?lang=en&pid=ob2e" target="_blank">converter</a>. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">But remember to take a backup before you convert "locker.bat" file because if you forgot the password "locker.bat" is the only file which will help you in retrieving the password.</span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">By converting the file nobody can view your password by right click and edit. </span><br />
<br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthu Nadar</b> (http://nadarmuthukumar.blogspot.in) </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Hope you liked this post, also let me know your thoughts on the post through your valuable comment. </span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Thank you.</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0tag:blogger.com,1999:blog-1066397658249108006.post-46911339958099636952013-06-07T17:56:00.000+05:302013-06-07T18:03:29.600+05:30Insert text at the cursor position in CKEditor<pre class="brush:javascript">function InsertHTML() {
CKEDITOR.instances['<%= CKEditor1.ClientID %>'].insertText('Your Text');
return false;
}
</pre>
<span style="font-family: "Trebuchet MS",sans-serif;"></span><br />
<span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar </b>(http://nadarmuthukumar.blogspot.in) </span><br />
<span style="font-family: "Trebuchet MS",sans-serif;">Hope you liked this post, also let me know your thoughts on the post through your valuable comment.
Thank you.</span>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0tag:blogger.com,1999:blog-1066397658249108006.post-19054268871610107372013-06-04T16:25:00.001+05:302013-06-04T16:36:59.294+05:30Unable to set Minimum and Maximum value of MultiHandleSliderExtender<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">Anyone who have this problem the solution is to reset or clear MultiHandleSliderExtender's ClientState using below code.
</span></span><br />
<pre class="brush:csharp">MultiHandleSliderExtender_Price.ClientState = "0";</pre>
<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">OR
</span></span><br />
<pre class="brush:csharp">MultiHandleSliderExtender_Price.ClientState = "45,55";</pre>
<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)
Hope you liked this post, also let me know your thoughts on the post through your valuable comment.
Thank you.</span></span>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0tag:blogger.com,1999:blog-1066397658249108006.post-23511391159824929012013-04-11T16:05:00.001+05:302013-04-11T16:05:26.869+05:30Convert List to DataTable in C#<pre class="brush:csharp">public DataTable ConvertToDataTable<T>(IList<T> data)
{
PropertyDescriptorCollection properties =
TypeDescriptor.GetProperties(typeof(T));
DataTable table = new DataTable();
foreach (PropertyDescriptor prop in properties)
table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);
foreach (T item in data)
{
DataRow row = table.NewRow();
foreach (PropertyDescriptor prop in properties)
row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
table.Rows.Add(row);
}
return table;
}
</pre>
<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar</b> (http://nadarmuthukumar.blogspot.in) </span></span><br />
<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">Hope you liked this post, also let me know your thoughts on the post through your valuable comment. </span></span><br />
<span style="font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">Thank you.</span></span>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Andheri East, Mumbai, Maharashtra, India19.1154908 72.87269519999995319.0554778 72.792014199999954 19.1755038 72.953376199999951tag:blogger.com,1999:blog-1066397658249108006.post-17403827177143219622013-04-06T16:49:00.002+05:302013-04-06T16:53:00.410+05:30Find median of an array in c#<div dir="ltr" style="text-align: left;" trbidi="on">
<pre class="brush:csharp">public static int GetMedian(int[] Value)
{
decimal Median = 0;
int size = Value.Length;
int mid = size / 2;
Median = (size % 2 != 0) ? (decimal)Value[mid] : ((decimal)Value[mid] + (decimal)Value[mid + 1]) / 2;
return Convert.ToInt32(Math.Round(Median));
}
</pre>
<span style="font-family: "Trebuchet MS",sans-serif;"><br /></span>
<span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar</b> (http://nadarmuthukumar.blogspot.in) </span><br />
<span style="font-family: "Trebuchet MS",sans-serif;">Hope you liked this and let me know your thoughts on post through your valuable comment.</span><br />
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Thank you </span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Evershine City Road, Vasai East, Vasai, Maharashtra, India19.4015501 72.83934610000005719.3978061 72.834303600000055 19.405294100000003 72.844388600000059tag:blogger.com,1999:blog-1066397658249108006.post-44529210252060827452013-03-19T15:49:00.001+05:302013-03-19T15:49:09.446+05:30Multiple users working on the same excel sheet<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]--><br />
<ol>
<li><!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]--><!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]--><span style="font-family: "Trebuchet MS",sans-serif;">Go to Tools>Share Workbook>Editing tab</span></li>
<li><span style="font-family: "Trebuchet MS",sans-serif;">Click Allow changes by more than one user at the same time checkbox if
needed and click OK</span></li>
<li><span style="font-family: "Trebuchet MS",sans-serif;">Save the workbook if prompted</span></li>
<li><span style="font-family: "Trebuchet MS",sans-serif;">Use File>Save As to save the workbook to be shared to a network location
to which both users have access
</span><span style="font-family: "Trebuchet MS",sans-serif;"><br /></span></li>
</ol>
<span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar</b> (http://nadarmuthukumar.blogspot.in)
Hope you liked this and let me know your thoughts on post through your comments :)</span>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Krantiveer Lakhuji Salve Marg, Mumbai, Maharashtra, India19.1213805 72.87052419999997719.113879 72.860439199999973 19.128882 72.880609199999981tag:blogger.com,1999:blog-1066397658249108006.post-91212124621570951342013-03-12T16:19:00.002+05:302013-03-12T16:19:41.715+05:30Get all tables name of database<div dir="ltr" style="text-align: left;" trbidi="on">
<pre class="brush: sql">SELECT *
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE'
</pre>
<span style="font-family: "Trebuchet MS",sans-serif;">Or
</span><br />
<pre class="brush: sql">SELECT *
FROM SYS.TABLES
</pre>
<br />
<span style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar </b>(http://nadarmuthukumar.blogspot.in)
Hope you liked this and let me know your thoughts on post through your comments :)</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Andheri, Maharashtra 400053, India19.113645 72.869733900000028-6.4083894999999984 31.561139900000029 44.6356795 114.17832790000003tag:blogger.com,1999:blog-1066397658249108006.post-54665762545990731932012-11-18T17:30:00.005+05:302012-11-18T17:30:59.435+05:30Clear the Recent Documents list in Windows 7<div style="font-family: "Trebuchet MS",sans-serif;">
<b>Method 1</b><br /> </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
Recent Items listed in the start menu are stored in:<br />%appdata%\Microsoft\Windows\Recent<br /> </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
Recent items listed in jump lists are stored in: <br />%appdata%\microsoft\windows\recent\automaticdestinations </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br />you can press Win+R and paste “%appdata%\Microsoft\Windows\Recent” and press OK will open the folder. You can select all file and press delete for manual process.</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br />And again press Win+R and paste “%appdata%\microsoft\windows\recent\automaticdestinations “ and press OK will open the folder. You can select all file and press delete for manual process.</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br />Or you can simply open command Prompt and paste this “del %appdata%\microsoft\windows\recent\automaticdestinations\* “ command and press enter, then press “Y” and press enter again will clear data automatically.</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<br /></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<b>Method 2 (Clear Recent history on exit)</b></div>
<div style="font-family: "Trebuchet MS",sans-serif;">
</div>
<ol style="font-family: "Trebuchet MS",sans-serif;">
<li>Go to Start menu, and type gpedit.msc in the search line and press Enter.</li>
<li>If prompted by UAC, click on Continue.</li>
<li>Now go to this folder : User Configuration\Administrative Templates\Start Menu and Taskbar.</li>
<li>Once you got to this folder, you will find ‘Clear history of recently opened documents on exit’ in the right pane, just double click on it.</li>
</ol>
<div style="font-family: "Trebuchet MS",sans-serif;">
<b>Method 3</b><br /> </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
<b>NOTE:</b> This option will also clear the Recent items in Jump Lists as well, and not just in the Start Menu.</div>
<div style="font-family: "Trebuchet MS",sans-serif;">
</div>
<ol style="font-family: "Trebuchet MS",sans-serif;">
<li>Right click on the Start button, and click on Properties.</li>
<li>Uncheck the Store and display recently opened items in the Start menu and the taskbar box, and click on Apply.</li>
<li>If you would like to turn recent items back on, then check the Store and display recently opened items in the Start menu and the taskbar box. </li>
</ol>
<div style="font-family: "Trebuchet MS",sans-serif;">
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in) </div>
<div style="font-family: "Trebuchet MS",sans-serif;">
Hope you liked this and let me know your thoughts on post through your comments :)</div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Vasai, Maharashtra, India19.392674 72.86164319.332763 72.782679 19.452585 72.940607tag:blogger.com,1999:blog-1066397658249108006.post-48702329724363391992012-10-01T12:45:00.000+05:302012-10-01T12:45:25.881+05:30Get last thursday of a month in C#<pre class="brush:csharp">
int Monthly = 1;
DateTime StartDate = new DateTime(2012, 01, 01);
DateTime EndDate = new DateTime(2012, 10, 01);
for (DateTime i = StartDate; i < EndDate; i = i.AddMonths(Monthly))
{
const int Thursday = 4;
const int DayDiff = 7 - Thursday;
//This will give me last day of month
int Day = DateTime.DaysInMonth(i.Year, i.Month);
//This will return any value from "0-7" where 0 is sunday.
int DayOfWeek = (int)new DateTime(i.Year, i.Month, Day).DayOfWeek;
DateTime _dtNew = new DateTime(i.Year, i.Month, Day).AddDays(-((DayOfWeek < Thursday) ? (DayOfWeek + DayDiff) : (DayOfWeek - Thursday)));
Response.Write(_dtNew.ToString("dd-MMM-yyyy") + "<br />");
}
</pre>
<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.295700918.149407500000002 73.2858304 18.1644955 73.3055714tag:blogger.com,1999:blog-1066397658249108006.post-73409364329236317002012-09-26T11:25:00.001+05:302012-09-28T10:49:18.108+05:30This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "Trebuchet MS", sans-serif;">Actually, this issue is not caused by IIS, the problem occurs when the following conditions are true:</span><br />
<ul>
<li><span style="font-family: "Trebuchet MS", sans-serif;">The <span style="font-family: "Courier New", Courier, monospace;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy <span style="font-family: "Trebuchet MS", sans-serif;">registry</span> </span>subkey is set to 1.</span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">ASP.NET 2.0 uses the RijndaelManaged implementation of the AES algorithm when it processes view state data. The ReindaelManaged implementation has not been certified by the National Institute of Standards and Technology (NIST) as compliant with the Federal Information Processing Standard (FIPS). Therefore, the AES algorithm is not part of the Windows Platform FIPS validated cryptographic algorithms.</span></li>
</ul>
<span style="font-family: "Trebuchet MS", sans-serif;">To work around this problem, change the configuration in the application-level Web.config file. Specify that ASP.NET use the Triple Data Encryption Standard (3DES) algorithm to process view state data. To do this, follow these steps:</span><br />
<ol>
<li><span style="font-family: "Trebuchet MS", sans-serif;">In a text editor such as Notepad, open the application-level Web.config file.</span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">In the Web.config file, locate the <system.web> section.</span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">Add the following <machineKey> section to in the <system.web> section: </span><span style="font-family: "Courier New", Courier, monospace;"><machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/></span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">Save the Web.config file.</span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">Restart the Microsoft Internet Information Services (IIS) service. To do this, run the following command at a command prompt: <strong>iisreset</strong></span></li>
</ol>
<span style="font-family: Trebuchet MS;">After doing this also if it is not working then set the subkey </span><span style="font-family: Courier New;">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy </span><span style="font-family: "Trebuchet MS", sans-serif;">value to 0</span><br />
<br />
<br /><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">), <span style="font-size: x-small;"><a href="http://support.microsoft.com/kb/911722" target="_blank">ref</a></span></span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.295700918.149407500000002 73.2858304 18.1644955 73.3055714tag:blogger.com,1999:blog-1066397658249108006.post-36297646270260394522012-09-17T11:41:00.000+05:302012-09-17T11:41:22.776+05:30Nested IF in Microsoft Excel<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: "Trebuchet MS", sans-serif;">It is possible to nest multiple IF functions within one Excel formula? Answer is “YES”.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">You can nest up to 7 IF functions to create a complex IF THEN ELSE statement.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">The syntax for the nesting the IF function is: <pre class="brush:vbnet">IF( condition1, value_if_true1, IF( condition2, value_if_true2, value_if_false2 ))
</pre>
</span>
<span style="font-family: "Trebuchet MS", sans-serif;">This would be equivalent to the following IF THEN ELSE statement: <pre class="brush:vbnet">IF condition1 THEN
value_if_true1
ELSEIF condition2 THEN
value_if_true2
ELSE
value_if_false2
END IF
</pre>
</span>
<span style="font-family: "Trebuchet MS", sans-serif;">This applies to Excel 2010, Excel 2007, Excel 2003, Excel XP and Excel 2000</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">), </span><a href="http://www.techonthenet.com/excel/formulas/if_nested.php" target="_blank"><span style="font-family: "Trebuchet MS", sans-serif; font-size: x-small;">Ref1</span></a><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.295700918.149407500000002 73.2858304 18.1644955 73.3055714tag:blogger.com,1999:blog-1066397658249108006.post-35083609136639091702012-09-13T10:53:00.001+05:302012-09-13T11:08:32.516+05:30Upload file to webserver using c#<div dir="ltr" style="text-align: left;" trbidi="on">
<ol style="text-align: left;">
<li><div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Trebuchet MS", sans-serif;">Place one Label, FileUpload and Button control to your page.</span></div>
</li>
<li><div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Trebuchet MS", sans-serif;">Name Label control as “lblMessage”, FileUpload control as “fuUpload” and Button control as “btnSubmit”</span></div>
</li>
<li><div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Trebuchet MS", sans-serif;">Create a Method as shown below,</span></div>
<pre class="brush:csharp">
private bool UploadFile()
{
bool _Result = false;
try
{
if (fuUpload.HasFile)
{
string strFileName = DateTime.Now.ToString("ddMMyyyy_HHmmss");
string strFileType = System.IO.Path.GetExtension(fuUpload.FileName).ToString().ToLower();
strFileName += fuUpload.FileName;
ViewState["FileName"] = strFileName;
if (strFileType.ToLower() == ".pdf")
{
fuUpload.SaveAs(Server.MapPath("~/Pdf/" + strFileName));
_Result = true;
}
else
{
lblMessage.Text = "Only pdf files allowed.";
_Result = false;
}
}
else
{
_Result = false;
lblMessage.Text = "Please select valid pdf file";
}
}
catch (Exception ex)
{
_Result = false;
lblMessage.Text = ex.Message;
}
return _Result;
}
</pre>
</li>
<li><div class="MsoNormal" style="margin: 0in 0in 10pt;">
<span style="font-family: "Trebuchet MS", sans-serif;">Now under btnSubmit_click event call the created method as shown below</span></div>
<pre class="brush:csharp">
if (UploadFile())
{
// You can get the uploaded file name from below viewstate
string FileName = Convert.ToString(ViewState["FileName"]);
}
</pre>
</li>
</ol>
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>
Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.295700918.149407500000002 73.2858304 18.1644955 73.3055714tag:blogger.com,1999:blog-1066397658249108006.post-44096962383967748002012-09-07T13:02:00.001+05:302012-09-07T13:05:45.031+05:30Increment for loop by step n<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Normally i++ increments i by 1, in order to increment i by nth count you can use i += n where n is any number.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">e.g. </span><br />
<pre class="brush:csharp">for (int i = 0; i < 11; i += 2)
{
Console.WriteLine(i);
}
</pre><span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-57541744503116256392012-09-07T10:10:00.001+05:302012-09-07T10:11:59.064+05:30Generate Random Code<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Import below into your Namespace</span><br />
<pre class="brush:csharp">using System.Security.Cryptography;</pre><span style="font-family: "Trebuchet MS", sans-serif;">Declare Below Variables</span><br />
<pre class="brush:csharp">public const string Alpha = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
public const string AlphaNumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
public const string Numeric = "1234567890";
</pre><span style="font-family: "Trebuchet MS", sans-serif;">Create a Enum as below</span><br />
<pre class="brush:csharp">public enum StringType { Alpha, AplhaNumeric, Numeric }
</pre><span style="font-family: "Trebuchet MS", sans-serif;">Create a Method as below</span><br />
<pre class="brush:csharp">public static string GenerateRandomCode(int CodeSize, StringType objStringType)
{
string RandomCode = string.Empty;
try
{
char[] chars = new char[62];
if (objStringType == StringType.AplhaNumeric)
chars = AlphaNumeric.ToCharArray();
else if (objStringType == StringType.Numeric)
chars = Numeric.ToCharArray();
byte[] data = new byte[1];
RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider();
crypto.GetNonZeroBytes(data);
data = new byte[CodeSize];
crypto.GetNonZeroBytes(data);
StringBuilder result = new StringBuilder(CodeSize);
foreach (byte b in data)
result.Append(chars[b % (chars.Length - 1)]);
RandomCode = result.ToString();
}
catch (Exception ex)
{
//throw ex;
}
return RandomCode;
}
</pre><span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><span style="font-family: "Trebuchet MS", sans-serif;">You can call the method using below code</span><br />
<pre class="brush:csharp">Response.Write(GenerateRandomCode(4, StringType.Numeric));
</pre><span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-59324408070385979102012-09-06T11:10:00.001+05:302012-09-06T11:11:16.988+05:3080070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Recently I was having a task to work with Word Automation. I have created word file and everything sucessfully. When I deployed the same to Server it failed and thown me below error,</span><br />
<code><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).</span></code><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">After going into lots of research below solution worked for me.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;"><system.web><br />
<identity impersonate="true"<br />
userName="Server User Name"<br />
password="Server Password" /><br />
</system.web></span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Add Above to your webconfig file.<br />
<br />
Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-60929703848656403652012-08-23T11:30:00.002+05:302012-08-23T11:32:32.584+05:30Set Default font to Gmail<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Every time I write an email from my Gmail account, I prefer the Comic Sans font for my message instead of the default one which is Sans Serif. This means every time I start composing an email I have to change the default font.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">The new feature has to be enabled under the Labs section within settings for Gmail. In the Labs section you need to look up Default Text Styling and select Enable along with saving the changes (see image below).</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcR-4iCe86Bs8VLRGZla6DzOCtISwbOtWJqfWV2lm-kCyqUFSxdBIx37lvERfq2Dr2ym8ZoiL4Oy_3aNcUbAk9K_KekHqWiTvy74ycwSChLAG3W-pU_HmFpj-LcShw32KijptqpUvaVSg/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "Trebuchet MS", sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcR-4iCe86Bs8VLRGZla6DzOCtISwbOtWJqfWV2lm-kCyqUFSxdBIx37lvERfq2Dr2ym8ZoiL4Oy_3aNcUbAk9K_KekHqWiTvy74ycwSChLAG3W-pU_HmFpj-LcShw32KijptqpUvaVSg/s1600/1.png" yda="true" /></span></a></div><span style="font-family: "Trebuchet MS", sans-serif;">Now after you have saved the changes, Gmail goes back to your Inbox. Again click on Settings and under the General tab you can see a new option enabled for changing the default font within Gmail (see image below).</span><br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi80tNFEn1YH762cyEW8Xo5ge_RNBvvNvk11MmrcmkafRLTDsNMHCWuoFU84fL_9zEwHcJrEvBNs9FMy2018k6VaVkg5sNwc1XOOmFmyjKIojGUL7JCaYPmy_GCZ1X4L5pv-tnEdRG7JYQ/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><span style="font-family: "Trebuchet MS", sans-serif;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi80tNFEn1YH762cyEW8Xo5ge_RNBvvNvk11MmrcmkafRLTDsNMHCWuoFU84fL_9zEwHcJrEvBNs9FMy2018k6VaVkg5sNwc1XOOmFmyjKIojGUL7JCaYPmy_GCZ1X4L5pv-tnEdRG7JYQ/s1600/2.png" yda="true" /></span></a></div><span style="font-family: "Trebuchet MS", sans-serif;">Select the font from the drop down menu and again save changes. This way you can change the default font you have on Gmail.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (</span><a href="http://nadarmuthukumar.blogspot.in/"><span style="font-family: "Trebuchet MS", sans-serif;">http://nadarmuthukumar.blogspot.in</span></a><span style="font-family: "Trebuchet MS", sans-serif;">) </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Hope you liked this and let me know your thoughts on post through your comments :)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-57243016557889422342012-07-24T11:29:00.001+05:302012-07-24T11:29:22.646+05:30Create Connection Strings easily<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">The connection string may include attributes such as the name of the driver, server and database, as well as security information such as user name and password.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
UDL file can be used to generate connection strings easily.<br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">To create UDL file first create new text file and rename it from "filename.txt" to "filename.udl" that's it.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Now run filename.udl by double clicking it.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Data Link Properties window will open, select Provider Tab and select the provider you need and click next.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Now provide the details as required and click on test connection.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">If you get success message, you are done.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Now open udl file as text file, connection string will be there in the last line.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar</strong> (<a href="http://nadarmuthukumar.blogspot.in/">http://nadarmuthukumar.blogspot.in/</a>), <a href="http://www.codeproject.com/Tips/158411/Get-DataBase-Connection-Strings-in-Easy-Way" target="_blank"><span style="font-size: x-small;">CodeProject</span></a></span></span> </div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-3712616374441973272012-07-14T23:51:00.001+05:302012-07-14T23:51:39.134+05:30The ‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly<div dir="ltr" style="text-align: left;" trbidi="on"><div style="font-family: "Trebuchet MS",sans-serif;">Visual Studio 2010 and SQL Server Express have an uneasy alliance, at best. When you install Visual Studio 2010 it installs SQL Server Express 2008 for you, but only the database engine, not SQL Server Management Studio. If you mess with SQL Server Express in order to install the management tools, or upgrade to 2008 R2, or install the Advanced Services version, things break and you can no longer reliably use the Visual Studio database projects.<br />
<br />
In particular, if you remove SQL Server Express 2008 and install SQL Server Express 2008 R2, you’ll probably run into an issue where if you try to open a schema object in a Visual Studio database project you’ll get an error that says:</div><div style="font-family: "Trebuchet MS",sans-serif;">"‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly"</div><div style="font-family: "Trebuchet MS",sans-serif;"><br />
</div><div style="font-family: "Trebuchet MS",sans-serif;">The fix for this problem can be found <a href="http://saintgimp.org/2012/01/10/fixing-the-vsts-for-database-professionals-sql-server-data-tier-application-package-did-not-load-correctly/" target="_blank">here</a>. Here’s the short version:</div><ol style="font-family: "Trebuchet MS",sans-serif; text-align: left;"><li>Locate your Visual Studio 2010 installation media.</li>
<li>In the \WCU\DAC folder, you’ll find three MSIs: DACFramework_enu.msi, DACProjectSystemSetup_enu.msi, and TSqlLanguageService_enu.msi. </li>
<li>Run and install each of them. </li>
<li>Reopen Visual Studio, it should be back to a working state.</li>
</ol><div style="font-family: "Trebuchet MS",sans-serif;">Reference: <b>Muthukumar</b> (http://nadarmuthukumar.blogspot.in)</div></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Vasai, Maharashtra, India19.392674 72.86164299999995819.3442745 72.792576499999953 19.441073499999998 72.930709499999963tag:blogger.com,1999:blog-1066397658249108006.post-13868652685396663902012-07-07T12:36:00.001+05:302012-07-07T12:36:44.943+05:30Meaning of decimal(18,2) Ms Sql Server<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">The actual syntax of the datatype is decimal(p,s).</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">So here, p is the precision and s is the scale. </span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">The datatype Decimal(18,2)is used to represent numbers.The length of numbers should be totally 18. The length of numbers after the Decimal point should be 2 only and not more than that.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">1234567898822222.88</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">The numbers to the left of decimal point should not be greater than 16.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">The numbers to the right of decimal point should not be greater than 2.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">(.) is excluded here in the length.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">So,the overall length of the number cannot exceed the length 18.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar</strong> (http://nadarmuthukumar.blogspot.in)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-80622823630412346582012-07-05T11:29:00.000+05:302012-07-05T11:29:53.294+05:30Convert dd mm yyyy string to datetime<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Create a function as shown below.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Your can use any one of the method give below inside the function, rest you can comment it out.</span><br />
<pre class="brush:csharp">private DateTime FormatDate(string _Date)
{
DateTime Dt;
//Method 1
System.Globalization.DateTimeFormatInfo dateInfo = new System.Globalization.DateTimeFormatInfo();
dateInfo.ShortDatePattern = "dd/MM/yyyy";
Dt = Convert.ToDateTime(_Date, dateInfo);
//Method 2
IFormatProvider mFomatter = new System.Globalization.CultureInfo("en-US");
Dt = DateTime.ParseExact(_Date, "dd/MM/yyyy", mFomatter);
//Method 3
Dt = DateTime.ParseExact(_Date, "dd/MM/yyyy", null);
return Dt;
}
</pre><span style="font-family: "Trebuchet MS", sans-serif;">To call the function use below code</span><br />
<pre class="brush:csharp">string UrDate = "27/08/2008";
DateTime _obj = FormatDate(UrDate);
</pre><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-21750366538059690042012-07-04T17:23:00.000+05:302012-07-04T17:23:47.287+05:30What is an application domain (appdomain)<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;"><strong>What is an application domain (appdomain)</strong></span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Before .NET framework 2.0 technology, the only way used to isolate applications running on the same machine is by the means of process boundaries. Each application run within a process, and each process has its own boundaries and memory addresses relative to it and this is how isolation from other processes was performed.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">.NET framework 2.0 introduces a new boundary called the Application Domains.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Application domain is nothing but a boundary within which an application runs.<br />
process can contain multiple application domains. Application domains provide an isolated environment to applications.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><br />
An application running inside one application domain cannot directly access the code running inside another application domain. To access the code running in another application domain, an application needs to use a proxy.</span><br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nt-ibh4CcLX7Ko4WdL82gALhPVEB0NGEaKHlxxusWYITfEIqAQNj9Qk-iQrgWV3Iv1IMvASnJGPnE5vsr-6_mq7crR2vI9loqoTrqzGYmiwDidmVk7THd9G5yKnHD5Ha5geGKKdmBAY/s1600/1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" sca="true" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0nt-ibh4CcLX7Ko4WdL82gALhPVEB0NGEaKHlxxusWYITfEIqAQNj9Qk-iQrgWV3Iv1IMvASnJGPnE5vsr-6_mq7crR2vI9loqoTrqzGYmiwDidmVk7THd9G5yKnHD5Ha5geGKKdmBAY/s1600/1.jpg" /></a></div><br />
<span style="font-family: "Trebuchet MS", sans-serif;">Application domain is used to isolate executed software applications from one another so that they do not affect each other. This is achieved by making any unique virtual address space run exactly one application and scopes the resources for the process or application domain using that address space.<br />
The .NET runtime enforces AppDomain isolation by keeping control over the use of memory - all memory in the AppDomain is managed by the .NET runtime, so the runtime can ensure that AppDomains do not access each other's memory.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Application Domain is used to create a mirror image of an application. reason being if you do not want to stop OR <br />
down the site , .Net framefork give u feature called App Domain, through which u can make the changes and uploaded <br />
to the site without getting it down or Stop.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">The main advantage is the ability to run several applications domains in a single process or application. All of this is performed while maintaning the same level and quality of isolation that would exist in separate processes, without the need of making cross-process calls or switching between processes.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;"><strong><u>Advantage</u></strong></span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><strong>isolation</strong>, code running in one application domain can not access code or resources running in another application domain.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><strong>security</strong>, You can control the permissions granted to a given piece of code by controlling the application domain inside which the code is running.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;"><strong>robustness</strong>, error in code running in one application domain can not affect other applications although they all are running inside the same process. Individual application domain can be stopped without stopping the entire process, you can simply unload the code running in a single application domain.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">They are less expensive than full processes<br />
They are multithreaded<br />
You can stop one without killing everything in the process<br />
Each app domain runs on its own security level</span><br />
<br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar</strong> (<a href="http://nadarmuthukumar.blogspot.in/">http://nadarmuthukumar.blogspot.in/</a>)</span><br />
<a href="http://www.netsqlinterviewquestions.com/-net_interview_questions/322_what-is-application-domain-appdomain-.aspx?topicid=2" target="_blank"><span style="font-family: "Trebuchet MS", sans-serif; font-size: x-small;">netsqlinterviewquestions</span></a>, <a href="http://www.dotnetfunda.com/interview/exam5096-what-is-an-application-domain.aspx" target="_blank"><span style="font-family: "Trebuchet MS", sans-serif; font-size: x-small;">dotnetfunda</span></a>, <a href="http://www.crazyengico.com/question.aspx?cid=1&qid=135" target="_blank"><span style="font-family: "Trebuchet MS", sans-serif; font-size: x-small;">crazyengico</span></a>, <a href="http://www.allinterview.com/showanswers/33671.html" target="_blank"><span style="font-family: "Trebuchet MS", sans-serif; font-size: x-small;">allinterview</span></a></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-42029016030452648592012-07-04T12:22:00.001+05:302012-07-04T12:23:15.660+05:30Get last inserted ID in sql server<div dir="ltr" style="text-align: left;" trbidi="on"><pre class="brush:sql">SELECT IDENT_CURRENT(‘tablename’)</pre><ol style="text-align: left;"><li><span style="font-family: "Trebuchet MS", sans-serif;">It returns the last IDENTITY value produced in a table, </span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">IDENT_CURRENT is limited to a specified table.</span></li>
<li><span style="font-family: "Trebuchet MS", sans-serif;">IDENT_CURRENT returns the identity value generated for a specific table.</span><span style="font-family: "Trebuchet MS", sans-serif;"><br />
</span></li>
</ol><span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar</strong> (<a href="http://nadarmuthukumar.blogspot.in/">http://nadarmuthukumar.blogspot.in/</a>), <a href="http://blog.sqlauthority.com/" target="_blank">SqlAuthority</a></span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-55587081752122984242012-06-20T14:19:00.001+05:302012-06-20T14:19:21.126+05:30Build Succeeded but Publish Failed<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Recently I faced an issue where my website is getting build successfully, means <strong>NO error</strong> <strong>NO warning NO MESSAGE,</strong> but if I try to publish it fails. </span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">To find solution for this you need to see your output window.</span><br />
<span style="font-family: "Trebuchet MS", sans-serif;">You can open the output window by pressing Ctl + w, O.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">In the output window you can check at which stage does the publish website operation fail.</span><br />
<br />
<span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar</strong> (http://nadarmuthukumar.blogspot.in)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932tag:blogger.com,1999:blog-1066397658249108006.post-13273723485614023912012-06-19T10:49:00.001+05:302012-06-19T10:51:56.316+05:30Pan Card Validation in C#<div dir="ltr" style="text-align: left;" trbidi="on"><span style="font-family: "Trebuchet MS", sans-serif;">Add below code to your head section of page under script tag.</span><br />
<pre class="brush:javascript">function chkPANLen(sender, args)
{
var PANno = document.getElementById("").value;
var pan = /^([A-Z a-z]{5})+([0-9]{4})+([A-Z a-z]{1})$/;
if (!(PANno.match(pan)))
{
args.IsValid = false ;
return;
}
args.IsValid = true ;
}
</pre><span style="font-family: "Trebuchet MS", sans-serif;">Below is the code to validate your control</span><br />
<pre class="brush:csharp">Pan No. :
<textbox id="txtPanNo" maxlength="10" runat="server"></textbox>
<regularexpressionvalidator controltovalidate="txtPanNo" display="None" errormessage="Invalid Pan Number." id="revPanNo" runat="server" setfocusonerror="true" validationexpression="^[a-zA-Z0-9]+$" validationgroup="Enrollment"></regularexpressionvalidator>
<customvalidator clientvalidationfunction="chkPANLen" controltovalidate="txtPanNo" display="None" errormessage="Invalid Pan Number." id="cvPan" runat="server" setfocusonerror="true" validationgroup="Enrollment"></customvalidator>
<validationsummary displaymode="List" id="ValidationSummary1" runat="server" showmessagebox="True" showsummary="False" validationgroup="Enrollment"></validationsummary>
<button id="btnSubmit" runat="server" text="Submit" type="submit" validationgroup="Enrollment"></button>
</pre><span style="font-family: "Trebuchet MS", sans-serif;">Reference: <strong>Muthukumar </strong>(http://nadarmuthukumar.blogspot.in)</span></div>Muthu Nadarhttp://www.blogger.com/profile/09756711616252936299noreply@blogger.com0Goregaon, Maharashtra, India18.1569515 73.29570089999992918.1529525 73.287686899999926 18.160950500000002 73.303714899999932