Pages

Search This Blog

Monday, March 15, 2010

Exception Details: System.UnauthorizedAccessException: Access to the path C:\xx\aa.xml is denied. ASP.NET is not authorized to access the requested re

Access to the path 'C:\xxx\aa.xml' is denied.

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.UnauthorizedAccessException: Access to the path 'C:\xxx\aa.xml' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Highlight the ASP.NET account, and check the boxes for the desired access.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[UnauthorizedAccessException: Access to the path 'C:\xxx\aa.xml' is denied.]    System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +651    System.IO.File.Delete(String path) +157    Admin_PropertyEdit.GenerateXML(Int64 pPropertyID, String pPropertyTypeName) +124    Admin_PropertyEdit.btnRemove_Click(Object sender, EventArgs e) +248    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746 

Hit above error when trying to write a xml file in the web server. I've tried to set write permission for both internet guest user & also ASP.NET user but still the same.

Finally, i add into web.config and the problem solve.
<identity impersonate="true"/>

syntax

<configuration>
<system.web>
<identity impersonate="true"/>
</system.web>
</configuration >



I'm not sure why, to know more, please check on

http://msdn.microsoft.com/en-us/library/72wdk8cc.aspx



Friday, February 19, 2010

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Received an error message on my windows desktop application (own developed) after install in a windows 7 64 bit (x64) machine.

____________________________________________
An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.
____________________________________________


We already follow the steps suggested:
When compiling the application in Visual Studio .NET 2008 you will need to force it to 32 bit mode.
You can do this by right-clicking the project name in the Solution Explorer and select Properties.
For VB.NET
Click Compile, then Advanced Compile Options. For the Target CPU drop down box, change it from "AnyCPU" to "x86" then click OK.
For C#.NET
Click Build and change the Platform Target option from "Any CPU" to "x86".
You should then be able to run the application on a 64 bit OS without error.

But it still show the same error

___________________________________________
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception. ---> CrystalDecisions.CrystalReports.Engine.LoadSaveReportException: An error has occurred while attempting to load the Crystal Reports runtime.

Either the Crystal Reports registry key permissions are insufficient or the Crystal Reports runtime is not installed correctly.

Please install the appropriate Crystal Reports redistributable (CRRedist*.msi) containing the correct version of the Crystal Reports runtime (x86, x64, or Itanium) required. Please go to http://www.businessobjects.com/support for more information.
xxxxxxxxxxx .......................................
_________________________________________

but finally i'm able to figure out the solution. The solution is go to cost you USD 10 if you wish to know. Write to me ...

Saturday, February 13, 2010

Happy Chinese New Year

Wish all Happy Chinese New Year! May this year of tiger bring you healthy, happy and wealthy!

Tuesday, February 9, 2010

windows upside down

don't panic ... my windows xp pro suddenly upside down after i press some key accidentally and the bad news is i dont know which key i've press. Luckily i finally found on web ..

To fix it:
answer: Ctrl & Alt & ↑ (up)

You will get it back to normal.

What causes the upside down?
answer: Ctrl & Alt & ↓ (down)

Tuesday, January 26, 2010

SQL query and optimization

I've run a simple test on sql query involve 2 tables, tblEmail & tblEmailPromotion

Table columns:
tblEmail (email varchar(255), IsDeleted int)
tblEmailPromotion (email varchar(255), PromotionID int)

Both tables without index

SELECT TOP (90) e.Email FROM tblEmail e
LEFT OUTER JOIN tblPromotionEmail pe ON e.Email = pe.Email AND pe.PromotionID = 6
WHERE pe.PromotionID IS NULL
AND e.IsDeleted = 0
AND e.Email LIKE '%hotmail%'
ORDER BY e.Email

It takes about 2:43 (2 minutes 43 seconds) to get the result

Change the question from "LEFT OUTER JOIN" to "IN" become

SELECT TOP (90) e.Email FROM tblEmail e
WHERE e.Email NOT IN (SELECT Email FROM tblPromotionEmail pe WHERE pe.PromotionID = 6)
AND e.IsDeleted = 0
AND e.Email LIKE '%hotmail%'
ORDER BY e.Email

Guest what? great improvement. Takes 1:07 (1 minute 7 seconds) to load the result.

Now, we index table tblEmail column Email (Unique)

SELECT TOP (90) e.Email FROM tblEmail e
LEFT OUTER JOIN tblPromotionEmail pe ON e.Email = pe.Email AND pe.PromotionID = 6
WHERE pe.PromotionID IS NULL
AND e.IsDeleted = 0
AND e.Email LIKE '%hotmail%'
ORDER BY e.Email

It takes about 1:22 (1 minute 22 seconds) to get the result

Now, we run the 2nd query:

SELECT TOP (90) e.Email FROM tblEmail e
WHERE e.Email NOT IN (SELECT Email FROM tblPromotionEmail pe WHERE pe.PromotionID = 6)
AND e.IsDeleted = 0
AND e.Email LIKE '%hotmail%'
ORDER BY e.Email

It only takes 27 Seconds

To make the 2nd query better:

SELECT TOP (90) e.Email FROM tblEmail e
WHERE e.Email NOT IN (SELECT Email FROM tblPromotionEmail pe WHERE pe.PromotionID = 6 AND pe.Email LIKE '%hotmail%')
AND e.IsDeleted = 0
AND e.Email LIKE '%hotmail%'
ORDER BY e.Email

This will give 15 seconds.

Summary:

We need to choose the query wisely.
Index will help to improve data retrieving process but must be careful with indexes. Wrong indexes may cause you more problem.

Friday, January 22, 2010

Saturday, January 16, 2010

Add Yahoo PingBox to Facebook fan page using FBML

Well, there do have Yahoo! Messenger Pingbox for facebook application but it's only able to add to personal profile and not to fan page.

What i'm going to do here is to add Yahoo! Messenger Pingbox to fan page using facebook static FBML application. Here, i'm not going to discuss on how to use FBML application, to see how FBML works, please check http://socialwants.com/development/adding-facebook-fan-page-applications/

Now, i have my Yahoo! Messenger Pingbox code.

<object id="pingbox0000000000000" type="application/x-shockwave-flash" data="http://wgweb.msg.yahoo.com/badge/Pingbox.swf" width="240" height="420"><param name="movie" value="http://wgweb.msg.yahoo.com/badge/Pingbox.swf" /><param name="allowScriptAccess" value="always" /><param name="flashvars" value="wid=xxxxxxxxxxxxxxxxxxx--" /></object>


In order to make it work in FBML, i have to change the above code to below

<fb:swf swfsrc='http://wgweb.msg.yahoo.com/badge/Pingbox.swf' imgsrc='http://www.encelabs.com/images/aaaaa.jpg' flashvars='wid=xxxxxxxxxxxxxxxxxxx--' width='184'height='320'/>



where imgscr is the image that will be displayed before pingbox load.

I'm able to get it run in my facebook fan page. Hope it work for you.

Tuesday, January 12, 2010

Invoice Software

Recently have downloaded and tested on a few invoice software/invoice system. Some are very complicated, some are not user friendly and some are very old design.

Surprisingly i found a very simple with very attractive user interface invoicing software. It can easily generate a quite professional quotation and invoice. It include delivery note as well but i'm not using it. It come with professional invoice template and we can customize the quotations & invoices's template field and wording and also can upload company logo.

It's very user friendly and the search feature is also very simple. Just nice customer maintenance module, and reporting module.

For the paid version, a very simple inventory module included in the software. Payment receive module and revenue reporting module. One thing want to highlight here is that the reports can drill down to more details level. Love it.

Simple and nice with very low price. Maybe you can try it. The software called Xin Invoice. The support is not bad and also there are some simple demo can find on their web and youtube. It's just suit my needs but i'm not sure for those who is running more complicated business.

Thursday, December 17, 2009

Failed to create the Crystal Query Engine Visual Studio 2005

When try to open crystal report in VS 2005, error message appear "Failed to open document" and followed by message "Failed to create the Crystal Query Engine".

I believe it same case with what discuss in http://social.msdn.microsoft.com/Forums/en/vscrystalreports/thread/79e1da80-f5c6-42fa-80ca-65a10de5729d .

The root cause maybe because of installation and uninstallation of merge module. Many recommend that we remove the crystal report, after that add crystal report back to visual studio. Steps below

  1. Go to Add/Remove Programs and select Change/Remove for Microsoft Visual Studio 2005
  2. Select Next then Add or Remove Features from the Visual Studio 2005 Maintenance Mode app
  3. Uncheck Crystal Reports for Visual Studio and select Update
  4. Once the "Update" is complete, select Finish
  5. Go back to Add/Remove Programs and select Change/Remove for Microsoft Visual Studio 2005
  6. Select Next then Add or Remove Features from the Visual Studio 2005 Maintenance Mode app
  7. Check Crystal Reports for Visual Studio and select Update
  8. Insert Disk 1 of Microsoft Visual Studio 2005 Installation CD's and select OK
  9. Once the "Update" is complete, select Finish

But in my case, i don't have installation CDs with me. So, i try an alternative way to get it work. You can try it but at your own risk.

I have another development machine which i call it machine B which have VS 2005 with crystal report install and working fine. The one have problem, i call it machine A. What i do is:

1. go to machine B, go to folder C:\Program Files\Common Files\Business Objects\2.7
2. copy the whole bin folder to a external drive or pendrive or thumb drive
3. close the visual studio 2005 in machine A if it's open
4. go to machine A, go to folder C:\Program Files\Common Files\Business Objects\2.7 and rename the bin folder to binA for backup purposes
5. copy the bin for the external drive to C:\Program Files\Common Files\Business Objects\2.7 in machine A
6. try to open visual studio 2005 and open the crystal report development file.
7. it working

It solve my problem especially when i don't have the installation cds with me at the moment. Hope this help

Saturday, December 12, 2009

Error 0xc00470fe: Data Flow Task: The product level is insufficient for component "Source - data1$" (1)

Trying to import data from a text file using MSSQL2005 SSIS import and export wizard to import data from email.txt into MSSQL data and found below error.

Error 0xc00470fe: Data Flow Task: The product level is insufficient for component "Source - email_txt" (1)

Surf around and found that it's a bug for MSSQL2005 SSIS and have fix in MSSQL SP2. So, try to download SP for mssql and it do solve my problem.