Welcome to my blog.

Post on this blog are my experience which I like to share. This blog is completely about sharing my experience and solving others query. So my humble request would be share you queries to me, who knows... maybe I can come up with a solution...
It is good know :-)

Use my contact details below to get directly in touch with me.
Gmail: nadarmuthukumar1987@gmail.com
Yahoo: nadarmuthukumar@yahoo.co.in

Apart from above people can share their queries on programming related stuff also. As me myself a programmer ;-)
Showing posts with label Error. Show all posts
Showing posts with label Error. Show all posts

Unable to set Minimum and Maximum value of MultiHandleSliderExtender

Anyone who have this problem the solution is to reset or clear MultiHandleSliderExtender's ClientState using below code.
MultiHandleSliderExtender_Price.ClientState = "0";
OR
MultiHandleSliderExtender_Price.ClientState = "45,55";
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.

This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms

Actually, this issue is not caused by IIS, the problem occurs when the following conditions are true:
  • The HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy registry subkey is set to 1.
  • 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.
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:
  1. In a text editor such as Notepad, open the application-level Web.config file.
  2. In the Web.config file, locate the <system.web> section.
  3. Add the following <machineKey> section to in the <system.web> section: <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
  4. Save the Web.config file.
  5. Restart the Microsoft Internet Information Services (IIS) service. To do this, run the following command at a command prompt: iisreset
After doing this also if it is not working then set the subkey HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy value to 0



Reference: Muthukumar (http://nadarmuthukumar.blogspot.in), ref
Hope you liked this and let me know your thoughts on post through your comments :)

80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

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,

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)).


After going into lots of research below solution worked for me.

<system.web>
<identity impersonate="true"
userName="Server User Name"
password="Server Password" />
</system.web>


Add Above to your webconfig file.

Reference: Muthukumar (
http://nadarmuthukumar.blogspot.in)
Hope you liked this and let me know your thoughts on post through your comments :)

The ‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly

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.

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:
"‘VSTS for Database Professionals Sql Server Data-tier Application’ package did not load correctly"

The fix for this problem can be found here.  Here’s the short version:
  1. Locate your Visual Studio 2010 installation media.
  2. In the \WCU\DAC folder, you’ll find three MSIs: DACFramework_enu.msi, DACProjectSystemSetup_enu.msi, and TSqlLanguageService_enu.msi.  
  3. Run and install each of them.
  4. Reopen Visual Studio, it should be back to a working state.
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

Build Succeeded but Publish Failed

Recently I faced an issue where my website is getting build successfully, means NO error NO warning NO MESSAGE, but if I try to publish it fails.

To find solution for this you need to see your output window.
You can open the output window by pressing Ctl + w, O.

In the output window you can check at which stage does the publish website operation fail.

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

no implicit conversion between null to int

I faced this issue twice now.

When I tried to use below code
DateTime? foo;
foo = string.IsNullOrEmpty(txtDate.Text) ? null : Convert.ToDateTime(txtDate.Text);
I get error as,
Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'System.DateTime'

Solution for the problem is below
DateTime? foo;
foo = string.IsNullOrEmpty(txtDate.Text) ? (DateTime?)null : Convert.ToDateTime(txtDate.Text);



Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

The given ColumnMapping does not match up with any column in the source or destination

Once I was working with SqlBulkCopy I was getting below error:
"The given ColumnMapping does not match up with any column in the source or destination."
If you are also facing the same issue, you need to look into below points.

1. Do you have TimeStamp columns in your table? Or do you have identity columns? If you have identity columns, you need to specify SqlBulkCopyOptions.KeepIdentity as shown below
SqlBulkCopy copy = new SqlBulkCopy("Your Connection String", SqlBulkCopyOptions.KeepIdentity)
2. If your Column name is "Address" and you are using it as "ADDRESS" then it is wrong, as columns on SQL Server 2005 are case sensitive.


Reference: Muthukumar (http://nadarmuthukumar.blogspot.in/)

executenonquery connection property has not been initialized.

This has bitten me twice now.
Code written below is Microsoft Patterns & Practices Enterprise Library 2.0 Data Access Layer.
Database database = DatabaseFactory.CreateDatabase("Your Connection String Name in Web Config");
string sqlcommand = "Your Stored Procedure Name";
DbCommand databasecommand = database.GetStoredProcCommand(sqlcommand);
database.AddInParameter(databasecommand, "@Status", DbType.String, "Complete");
int i = databasecommand.ExecuteNonQuery();
This looks fairly straight forward. However, if you run it you will get the error, "executenonquery connection property has not been initialized."
The proper way to call ExecuteNonQuery above is

int i = database.ExecuteNonQuery(databasecommand);
Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

printdialog always using default printer

I have the following code to show printer dialog box but no matter what printer I choose, it always prints to the default printer.
 
PrintDialog pdlg = new PrintDialog();

// Show the PrintDialog
if (pdlg.ShowDialog() == DialogResult.OK)
{
   PrintDocument pd = new PrintDocument();

   // Associate PrintDocument object with the PrintDialog
   pdlg.Document = pd;
   pd.PrinterSettings = pdlg.PrinterSettings;
   
   pd.Print();
}

Solution:
Just Swapped Document and Printer Settings as below, and it worked for me.

PrintDialog pdlg = new PrintDialog();

// Show the PrintDialog
if (pdlg.ShowDialog() == DialogResult.OK)
{
   PrintDocument pd = new PrintDocument();
   
   pd.PrinterSettings = pdlg.PrinterSettings;

   // Associate PrintDocument object with the PrintDialog
   pdlg.Document = pd;
   pd.Print();
}

Reference: Muthukumar (http://nadarmuthukumar.blogspot.in)

Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

This basically happens when your website is targeting ASP.NET 4.0 and the application pool is set to run ASP.NET 2.0.

Solution
To do this follow the steps below:
Log-in into your hosting control panel.
Select “Websites” from Hosting Space Menu on the left side.



Click on your website to see website properties.
Select “Extensions” tab. Here you will set ASP.NET version to your desired one. I selected ASP.NET 4.0 in my case and everything is going fine now.


If the above solution fails, simply remove “targetFramework” and everything will go fine after your set website’s properties from Extension tab.

telnet is not recognized as an internal or external command operable program or batch file

Solution
Go to "Control Panel > Programs and Features" and then you will find something like "Turn Windows features" or "Advanced" ....You should find the option "telnet client" and select the option and click OK.

String was not recognized as a valid DateTime

I got this error when I was trying to convert date string with format dd/MM/yyyy.
Solution:
First Import below Namespace
using System.Globalization;
Replace STRDATE with your date. And use any of the below code for conversion.
Datetime DT = DateTime.ParseExact(STRDATE,"dd/MM/yyyy",System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat)
OR
DateTime date = DateTime.ParseExact(STRDATE, "dd/MM/yyyy", CultureInfo.InvariantCulture);
OR
DateTime date = DateTime.ParseExact(STRDATE, "dd/MM/yyyy", null);

Cannot start Microsoft Office Outlook. Cannot open the Outlook window.

When you start Outlook 2007, you receive the following error:
Cannot start Microsoft Office Outlook. Cannot open the Outlook window.

This problem can occur when file that maintains the Navigation Pane settings becomes corrupted. This file is called profilename.xml, where profilename is the name of your Outlook profile. This file is stored in the following folder:

Windows XP

C:\Documents and Settings\username\Application Data\Microsoft\Outlook
Windows Vista, Windows 7

C:\Users\username\AppData\Roaming\Microsoft\Outlook

A good indication this file is corrupted is when the file size is 0 KB.

To resolve this problem, use the following steps.

On the Start menu click Run.
In the Run dialog box, type the following command:

Outlook.exe /resetnavpane

Note: There is a space between "Outlook.exe" and "/resetnavpane"
Click OK.

Note If you are using Windows Vista or Windows 7, you may not see Run on the Start menu. In this situation, use the following steps to locate the Run option.

On the Start menu click All Programs.
Click Accessories.
Click Run.

System.OutOfMemoryException

When I was trying to fetch about 145000 records, I was getting error as below

Exception of type 'System.OutOfMemoryException' was thrown.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Solution
1. Use Paging to your gridview.

Twitter Delicious Facebook Digg Stumbleupon Favorites More