Pages

Search This Blog

Sunday, December 19, 2010

Xin Invoice software 2.0 holiday season and year end promotion

Xin Cube is running promotion for Xin Invoice product for 16th December 2010 to 31st December 2010. The discount up to 37% for Xin Invoice software version 2.0. for more information, visit: http://www.xininvoice.com . Press release can be found in http://www.free-press-release.com/news-xin-invoice-software-2-0-holiday-season-and-year-end-promotion-1292512710.html

Tuesday, December 7, 2010

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Facing issue when try to connect to MSSQL 2005 Express from remote server

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

To solve this issue

1. Enable TCP/IP


Go to Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Configuration Manager


Make sure TCP/IP is Enabled



2. Make sure MS SQL allow remote connection with TCP/IP protocol.

Go to Programs -> Microsoft SQL Server 2005 -> Configuration Tools -> SQL Server Surface Area Configuration


Click on Surface Area Configuration for Services and Connections


Make sure Local and remote connections and using TCP/IP only is selected.


3. Open port for Port: 1433, sqlbrowser.exe and sqlservr.exe in windows firewall.
Launch the Windows Firewall configuration tool from the control panel.
Click the Exceptions Tab
Click on Add Port, key in information as below




Repeat above but this time click the "Add Programs." button and select "sqlservr.exe" from the 
location where you install SQL Server Express (normally in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn)
Report the same steps but select "sqlbrowser.exe" (normally in: C:\Program Files\Microsoft SQL Server\90\Shared)



 Try again and the problem solved. Hope this help.




Monday, November 22, 2010

invoice software - Xin Invoice 3 release

Xin Cube announce that new version of invoice software - xin invoice 3.0 has released. The invoice software come with new features and new invoice template.


For more information, refer to the press release http://www.prlog.org/11089459-invoice-software-xin-invoice-new-version-30-released-by-xin-cube.html or http://www.free-press-release.com/news-invoice-software-xin-invoice-new-version-3-0-released-by-xin-cube-1290268955.html . For video demo, please refer to http://www.youtube.com/user/xincube

MySQL Server 5.1 data folder

My development machine have MySQL server 5.0 installed and i upgrade to version 5.1.

After i've installed MySQL server 5.1, i can't found the data folder which normally in "C:\program files\MySQL\MySQL Server 5.0\data" for version 5.0.

Finally able to get the location in in "C:\Users\All Users\MySQL\MySQL Server 5.1\data" for Windows Vista

If you are using windows XP, it's in "C:\Documents and Settings\All Users\MySQL\MySQL Server 5.1\data"

Hope this help

Sunday, October 17, 2010

MS SQL profiler like for mysql

I was looking around a software for MySQL that can work like MSSQL profiler which can monitor the SQL query executed. Finally i found one called Log Monitor which work well for me.


How it's work? Download Log Monitor. Open LogMonitor.jar file.


Connect to MySQL server, open a SQL Query window and run this script



SET GLOBAL general_log = 'ON';



Check on log file location in my.ini file (for windows user) or my.cnf (for linux user).

For windows user,
#Path to the database root
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"

Open Log Monitor and set "log file path" with the file name. 




Now, open another SQL Query window and run any script. You can see the query you run displayed in the Log Monitor.



Hope this help.

Tuesday, October 12, 2010

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Face strange error when try to print report using crystal report.

Server Error in 'xxx' Application.

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

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.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

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:



[AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.]
CrystalDecisions.ReportAppServer.ClientDoc.ReportClientDocumentClass.Open(Object& DocumentPath, Int32 Options) +0
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.Open(Object& DocumentPath, Int32 Options) +95
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +271


[Exception: Load report failed.]
CrystalDecisions.ReportAppServer.ReportClientDocumentWrapper.EnsureDocumentIsOpened() +333
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename, OpenReportMethod openMethod, Int16 parentJob) +894
CrystalDecisions.CrystalReports.Engine.ReportDocument.Load(String filename) +84
Transaction_InvoicePrint.Print() +149
Transaction_InvoicePrint.Page_Load(Object sender, EventArgs e) +5
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627



I'm not sure what could cause this issue but after i reset iis, everything work fine.

Friday, October 1, 2010

mysql 5.1 data folder / directory / location

I've installed new MySQL 5.1 to replace my MySQL 5.0. I cannot find my data folder. 
Finally, check my.ini file in MySQL 5.1 folder and found line below


datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"


All data folder is in "C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"



Tuesday, September 21, 2010

ASP.NET Security Vulnerability: Take Action Immediately

This is very important for those who have asp.net application running out there. Attacker can get data encrypted data in view state or web.config data if you ignore this.

Detail informations and workaround stated in Scottgu's Blog


For more others information, please refer to


Monday, September 20, 2010

Keep track download in ASP.NET

Situation:
I have a software in my web server and let visitor download for free, i wish to keep track of total download and visitor location. 

Feasibility:
For the location keep tracking, i use GeoIP (GeoLiteCity.dat) http://www.maxmind.com/app/ip-location 

Solution:

Database:
I have create a table called downloadlog with field below. I plan to have different type of product in future, so i add ProductFamilyID field. If you don't have that, you can ignore it.















Now, i need a stored procedure called psp_DownloadLog_Add that insert data into table above. The code should be as simple as possible



CREATE PROCEDURE [dbo].[psp_DownloadLog_Add]
(
@p_IP NVARCHAR(50),
@p_Country NVARCHAR(255),
@p_CountryCode VARCHAR(50),
@p_City NVARCHAR(255),
@p_ReferrerURL        NVARCHAR(512),
@p_ProductFamilyID INT
)
AS
BEGIN
SET NOCOUNT ON;

INSERT INTO tblDownloadLog
(
IP,
Country,
CountryCode,
City,
ProductFamilyID,
ReferrerURL,
DownloadDate
)
VALUES
(
@p_IP,
@p_Country,
@p_CountryCode,
@p_City,
@p_ProductFamilyID,
@p_ReferrerURL,
GETDATE()
)

SET NOCOUNT OFF;

END

ASP.NET

To make the system more structural and manageable, I have create 2 classes to handle the download log. DownloadLogInfo class mainly is use the deal with the information that need to log into database. DownloadLog class is mainly the class who do the communication with the database. Please check the code below.

DownloadLogInfo class



 public sealed class DownloadLogInfo
    {
         public DownloadLogInfo() { }
        
         int _downloadID = 0;
         string _ip = "";
         string _country = "";
         string _countryCode = "";
         string _city = "";
         int _productFamilyID = 0;
         string _referrerURL = "";
         DateTime _downloadDate = DateTime.Now;


         public int DownloadID { get { return _downloadID; } set { _downloadID = value; } }
         public string IP { get { return _ip; } set { _ip = value; } }
         public string Country { get { return _country; } set { _country = value; } }
         public string CountryCode { get { return _countryCode; } set { _countryCode = value; } }
         public string City { get { return _city; } set { _city = value; } }
         public int ProductFamilyID { get { return _productFamilyID; } set { _productFamilyID = value; } }
         public string ReferrerURL { get { return _referrerURL; } set { _referrerURL = value; } }
         public DateTime DownloadDate { get { return _downloadDate; } set { _downloadDate = value; } }

         public DownloadLogInfo(int pDownloadID, string pIP, string pCountry, string pCountryCode, string pCity, int pProductFamilyID, string pReferrerURL, DateTime pDownloadDate)
         {
             _downloadID = pDownloadID;
             _ip = pIP;
             _country = pCountry;
             _countryCode = pCountryCode;
             _city = pCity;
             _productFamilyID = pProductFamilyID;
             _referrerURL = pReferrerURL;
             _downloadDate = pDownloadDate;

         }


    }

DownloadLog Class

    public sealed class DownloadLog
    {
        public void Add(DownloadLogInfo pInfo, string pConnectionString)
        {
            SpParamInfo[] myParamInfo = new SpParamInfo[6];
            myParamInfo[0] = new SpParamInfo("@p_IP", SqlDbType.NVarChar, pInfo.IP);
            myParamInfo[1] = new SpParamInfo("@p_Country", SqlDbType.NVarChar, pInfo.Country);
            myParamInfo[2] = new SpParamInfo("@p_CountryCode", SqlDbType.NVarChar, pInfo.CountryCode);
            myParamInfo[3] = new SpParamInfo("@p_City", SqlDbType.NVarChar, pInfo.City);
            myParamInfo[4] = new SpParamInfo("@p_ProductFamilyID", SqlDbType.Int, pInfo.ProductFamilyID);
            myParamInfo[5] = new SpParamInfo("@p_ReferrerURL", SqlDbType.NVarChar, pInfo.ReferrerURL);

            DbAdapter myDbAdapter = new DbAdapter(pConnectionString);
            myDbAdapter.ExecuteNonQuery("psp_DownloadLog_Add", myParamInfo);

            myDbAdapter.Dispose();

        }

    }

Now, I have create a page, call download.aspx. This page will actually get information from the visitor and insert into database. After that it will force a file to be downloaded. Before that, i already GeoLiteCity.dat file and put into my App_Data folder.


Code behind for download.aspx


protected void Page_Load(object sender, EventArgs e)
    {
        string VisitorReferrer;

        // Full path to GeoLiteCity.dat file
        string FullDBPath = Server.MapPath("~/App_Data/GeoLiteCity.dat");
        // Visitor's IP address
        string VisitorIP; 
            
        VisitorIP  = Request.ServerVariables["REMOTE_ADDR"];
      
        if (Request.UrlReferrer != null)
        {
            VisitorReferrer = Request.UrlReferrer.ToString();
        }
        else
        {
            VisitorReferrer = "";
        }

        // Create objects needed for geo targeting
        Geotargeting.LookupService ls = new Geotargeting.LookupService(FullDBPath, Geotargeting.LookupService.GEOIP_STANDARD);
        Geotargeting.Location visitorLocation = ls.getLocation(VisitorIP);
        
        DownloadLog myDownloadLog = new DownloadLog();
        DownloadLogInfo myDownloadLogInfo = new DownloadLogInfo();


        if (visitorLocation != null) // get the geoip information using visitor IP address
        {
            myDownloadLogInfo.Country = visitorLocation.countryName;
            myDownloadLogInfo.CountryCode = visitorLocation.countryCode;
            myDownloadLogInfo.City = "unknown";
            if (visitorLocation.city != null)
            {
                myDownloadLogInfo.City = visitorLocation.city;
            }
            
            myDownloadLogInfo.IP = VisitorIP;
            myDownloadLogInfo.ProductFamilyID = 1;
            myDownloadLogInfo.ReferrerURL = VisitorReferrer;
        }
        else
        {
            string country = "unknown";
            string countryCode = "unknown";
            string city = "unknown";
            myDownloadLogInfo.Country = country;
            myDownloadLogInfo.CountryCode = countryCode;
            myDownloadLogInfo.City = city;
            myDownloadLogInfo.IP = VisitorIP;
            myDownloadLogInfo.ProductFamilyID = 1;
            myDownloadLogInfo.ReferrerURL = VisitorReferrer;
        }

       
       // WebConfig.Connection is the connection the database and insert data into database
       myDownloadLog.Add(myDownloadLogInfo, WebConfig.Connection);
        
       Response.ContentType = "application/zip";
       Response.AddHeader("content-disposition", "attachment; filename=softwaresetup.zip");

       FileStream sourceFile = new FileStream(@"C:\inetpub\dotnetfish\software\softwaresetup.zip", FileMode.Open);
        
       long FileSize;
       FileSize = sourceFile.Length;
       byte[] getContent = new byte[(int)FileSize];
       sourceFile.Read(getContent, 0, (int)sourceFile.Length);
       sourceFile.Close();

       Response.BinaryWrite(getContent);
    }

Tuesday, September 14, 2010

Cannot Delete xxx: Access is denied Make sure the disk is not full or write-protected and that the file is not currently in use

Have you come across the annoying error when try to delete files from you computer or even external harddisk? 
I've tried to change the permission setting in security tab but i cannot do anything because only system can change the setting. 

Finally, i found a tool named unlocker http://download.cnet.com/Unlocker/3000-2248_4-10493998.html that help me to delete the files.

Hope this help.

Attempted to read or write protected memory. This is often an indication that other memory has been corrupted.


Hit below error when deploy a new app to existing running application.

Attempted to read or write protected memory. This is often an indication that other memory has been corrupted. 
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.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory has been corrupted. 



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.


Try to set the folder permission but still hit the same error after restart iis. 


Next, i try to run the permissions wizard in the IIS. After run it, restart iis and i'm lucky. It work like normal.








Hope this help.



Saturday, July 17, 2010

Convert CString to std::string and vice versa

// convert from std:string to CString
CString errorMsg'
std::string encodeError = "Error 01";
errorMsg = CString(encodeError.c_str());



// convert from CString to std:string
CString csData = "f1db14dfa5d54f0b";
std::string ssData((LPCTSTR)csData);

Convert CString to char array

Again, when use CString, remember to include afxwin.h

char csRoom [20];
BSTR sRoom = "102";

CString myString1(sRoom);
strcpy(csRoom,myString1);

now, value from CString copied to char array

Convert BSTR to CString

When use CString, remember to include afxwin.h in your header.

BSTR sComPortNumber = "COM1";

//declare CString csComPortNumber and convert BSTR cComPortNumber to CString

CString csComPortNumber(sComPortNumber);

DONE.

Monday, March 29, 2010

Failed to access IIS metabase. An unhandled exception occurred during the execution of the current web request. Please review the stack ...

Hit below error when try to setup and new application in IIS.

Server Error in '/encelabs' Application.

--------------------------------------------------------------------------------

Failed to access IIS metabase.

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.Web.Hosting.HostingEnvironmentException: Failed to access IIS metabase.

The process account used to run ASP.NET must have read access to the IIS metabase (e.g. IIS://servername/W3SVC). For information on modifying metabase permissions, please see http://support.microsoft.com/?kbid=267904.

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:

[HostingEnvironmentException: Failed to access IIS metabase.]
System.Web.Configuration.MetabaseServerConfig.MapPathCaching(String siteID, VirtualPath path) +3492170
System.Web.Configuration.MetabaseServerConfig.System.Web.Configuration.IConfigMapPath.MapPath(String siteID, VirtualPath vpath) +9
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +163
System.Web.CachedPathData.GetConfigPathData(String configPath) +382
System.Web.CachedPathData.GetConfigPathData(String configPath) +243
System.Web.CachedPathData.GetApplicationPathData() +68
System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp) +3385679
System.Web.Configuration.RuntimeConfig.GetLKGRuntimeConfig(VirtualPath path) +189


Version Information: Microsoft .NET Framework

________________________________________________________

Solution:
For my case, the reason hit above error is because.NET Framework was installed before IIS server. To solve the problem, register .NET framework to IIS will do.

How to do that? (please be aware that the sample using for.NET Framework V1.0)

Steps:

1. Click on Start -> Run






2. Type in cmd and click OK





3. Command prompt screen will appear. go to"C:\Windows\Microsoft.NET\Framework\
v2.0.50727" folder by using command cd C:\Windows\Microsoft.NET\Framework\v2.0.50727 and hit enter. Please refer screen below:





4. Type in
aspnet_regiis -i and hit enter.




5. Screen below will be shown and dotnet user installed.




aspnet_regiis -i

alternatively you can copy and paste this command into windows command prompt

%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe -i

Ping a port

Well, sometimes we need to know whether the port in open or block, we need to do some checking or troubleshoot through ping/telnet. We cannot ping a IP with port but we can telnet certain IP together with Port no.

For example:
Go to open command prompt, if we want to check whether port 21 is working for IP 203.166.87.9 what we need to do is
> telnet 203.166.87.9 21

please tell me it's work. thanks

Thursday, March 25, 2010

Could not load file or assembly 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependenci

Deploy a web application that uses crystal report basic 10.5 and hit below error when try to access to the application.

"Could not load file or assembly 'CrystalDecisions.Web, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304' or one of its dependencies. The system cannot find the file specified."

This is because we dont have crystal report basic runtime installed in the server.

Where do I get the basic (10.5) runtime? It's on your machine:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5

My server is a 32 bit machine, so i install CRRedist2008_x86.msi in the machine.

Now what? I still can the same error? Wait, we need to restart the IIS to make it work. After restart the IIS, it's work perfectly.

STOP: c000021a (Fatal System error) The windows subsystem system process terminated unexpectedly with a status 0xc0000005

I hit below error/blue screen when trying to install MSSQL 2005 Express in a Microsoft XP pro SP2 machine:

STOP: c000021a (Fatal System error)
The windows subsystem system process terminated unexpectedly with a status 0xc0000005 (0x7c9106c3 0x0053ec24)

Try for 3 times to reinstall windows and no luck. Hit the same error when installing MSSQL 2005 Express.

Finally found an forum
http://blogs.msdn.com/petersad/archive/2009/01/20/sql-server-2005-sp3-sql-server-2005-sp2-cus-or-sql-server-2008-may-cause-xp-sp2-to-restart.aspx

And hotfix in http://support.microsoft.com/kb/943232

We have to register our email and the hotfix link come with password with send to our email.

After apply both hotfix. My problem solved.

Wednesday, March 24, 2010

Status of package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' after install is 'InstallFailed'

Trying install Crystal Reports Basic for Visual Studio 2008 in XP Pro SP2 and hit bellow error.

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 5.1.2 {version}
Running checks for package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)', phase BuildList
Running MsiProductCheck with ProductCode '{AA467959-A1D6-4F45-90CD-11DC57733F32}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'CRVSInstalled'
Running MsiProductCheck with ProductCode '{CE26F10F-C80F-4377-908B-1B7882AE2CE3}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'CRVSRunTimex86Installed'
Running MsiProductCheck with ProductCode '{2BFA9B05-7418-4EDE-A6FC-620427BAAAA3}. '
MsiQueryProductState returned '-2'
Setting value '-2 {int}' for property 'CRVSRunTimex64Installed'
The following properties have been set for package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)':
Property: [CRVSInstalled] = -1 {int}
Property: [CRVSRunTimex64Installed] = -2 {int}
Property: [CRVSRunTimex86Installed] = -1 {int}
Running checks for command 'CrystalReports10_5\CRRedist2008_x86.msi'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': false
Result of running operator 'ValueGreaterThan' on property 'CRVSInstalled' and value '0': false
Result of running operator 'ValueGreaterThan' on property 'CRVSRunTimex86Installed' and value '0': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Skipping FailIf because Property 'Version9x' was not defined
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.00': false
Result of checks for command 'CrystalReports10_5\CRRedist2008_x86.msi' is 'Install'
Running checks for command 'CrystalReports10_5\CRRedist2008_x64.msi'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'AMD64': true
Result of checks for command 'CrystalReports10_5\CRRedist2008_x64.msi' is 'Bypass'
'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' RunCheck result: Install Needed
EULA for components 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' was accepted.
Copying files to temporary directory "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VSD1.tmp\"
Copying from 'C:\Documents and Settings\Administrator\Desktop\XinInvoiceSetup2_new\XinInvoiceSetup2\CrystalReports10_5\CRRedist2008_x86.msi' to 'C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VSD1.tmp\CrystalReports10_5\CRRedist2008_x86.msi'
Verifying file integrity of C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VSD1.tmp\CrystalReports10_5\CRRedist2008_x86.msi
WinVerifyTrust returned 0
File trusted
Running checks for package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)', phase BeforePackage
Running MsiProductCheck with ProductCode '{AA467959-A1D6-4F45-90CD-11DC57733F32}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'CRVSInstalled'
Running MsiProductCheck with ProductCode '{CE26F10F-C80F-4377-908B-1B7882AE2CE3}'
MsiQueryProductState returned '-1'
Setting value '-1 {int}' for property 'CRVSRunTimex86Installed'
Running MsiProductCheck with ProductCode '{2BFA9B05-7418-4EDE-A6FC-620427BAAAA3}. '
MsiQueryProductState returned '-2'
Setting value '-2 {int}' for property 'CRVSRunTimex64Installed'
The following properties have been set for package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)':
Property: [CRVSInstalled] = -1 {int}
Property: [CRVSRunTimex64Installed] = -2 {int}
Property: [CRVSRunTimex86Installed] = -1 {int}
Running checks for command 'CrystalReports10_5\CRRedist2008_x86.msi'
Result of running operator 'ValueNotEqualTo' on property 'ProcessorArchitecture' and value 'Intel': false
Result of running operator 'ValueGreaterThan' on property 'CRVSInstalled' and value '0': false
Result of running operator 'ValueGreaterThan' on property 'CRVSRunTimex86Installed' and value '0': false
Result of running operator 'ValueEqualTo' on property 'AdminUser' and value 'false': false
Skipping FailIf because Property 'Version9x' was not defined
Result of running operator 'VersionLessThan' on property 'VersionNT' and value '5.00': false
Result of checks for command 'CrystalReports10_5\CRRedist2008_x86.msi' is 'Install'
'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' RunCheck result: Install Needed
Verifying file integrity of C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VSD1.tmp\CrystalReports10_5\CRRedist2008_x86.msi
WinVerifyTrust returned 0
File trusted
Installing using command 'C:\WINDOWS\system32\msiexec.exe' and parameters ' -I "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\VSD1.tmp\CrystalReports10_5\CRRedist2008_x86.msi" -q /norestart'
Process exited with code 1603
Status of package 'Crystal Reports Basic for Visual Studio 2008 (x86, x64)' after install is 'InstallFailed'

Fix:
Install .NET 2.0 Framework will solve the problem

Sunday, March 21, 2010

Parser Error Message: Section or group name 'system.web.extensions' is already defined.

facing below error in my development machine when i try to access to one of my application that running in ASP.NET framework 2.0

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Section or group name 'system.web.extensions' is already defined. Updates to this may only occur at the configuration level where it is defined.

Source Error:

Line 2:   Line 3:    Line 4:     Line 5:      Line 6:      

Source File: C:\Inetpub\wwwroot\xxxxx\web.config Line: 4



Section or group name 'scripting' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 5)
Section or group name 'scriptResourceHandler' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 6)
Section or group name 'webServices' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 7)
Section or group name 'jsonSerialization' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 8)
Section or group name 'profileService' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 9)
Section or group name 'authenticationService' is already defined. Updates to this may only occur at the configuration level where it is defined. (C:\Inetpub\wwwroot\formlookup_ajax2\web.config line 10)


Situation:

In My IIS setting
My Default Web Site Location path point to an application that running asp.net framework 3.5
When i access to one of my application that park under Default Web Site that running in asp.net framework 2.0, it hits error above.

Solution:
Remove the Default Web Site Location path solve my problem.

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.