Web App Development

Monday, December 21, 2009

Query AD Group

To find out members in an AD group

dsquery group -samid groupname|dsget group -members

Labels: ,

Friday, December 18, 2009

Cannot create/shadow copy [File] when that file already exists.

Problem

Cannot create/shadow copy [File] when that file already exists.

Resolution

  1. Wait a few minutes before trying to start debugging again, this error occurs when VS 2005 is trying to build the application and locks some of the resources
  2. If step 1 does not work, reset IIS

Tuesday, October 13, 2009

Multiple databases and SSIS - Sybase ASE OLE DB Driver

Scenario

Creating SSIS package to import data into SQL Server 2008 from Sybase ASE database. The ASE OLE DB connection uses a login that has access to multiple databases on the same server

Problem

Only one database was visible through SSIS even though the initial catalog was set up to use the second database

Resolution

Create a new SSIS project; Looks like SSIS cannot handle connections to 2 databases simultaneously!

Labels: , ,

Tuesday, May 13, 2008

Failed to fire the WMI event

Error

Failed to fire the WMI event 'SecurityAuthorizationCheckEvent'. Exception: System.Management.ManagementException: Access denied

Platform

W2k3, ASP.NET 2.0, Enterprise Library 2.0

Cause

Enterprise library uses various instrumentation blocks (WMI events, event log, and performance counters). These instrumentation blocks are not configured during install

How to Fix It

There are 3 ways to do it:

  1. Run the "Install Services" script from the Enterprise Library folder on the Start Menu (this launches InstallServices.bat). You need administrator privileges to run this script.
  2. Run the .NET installutil utility over the Enterprise Library assemblies you are using for your application (requires administrator privileges as well)
  3. cd C:\WINNT\Microsoft.NET\Framework\v1.1.4322

    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Common.dll"
    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Caching.dll" installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Configuration.dll" installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll"
    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Data.dll"
    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll"
    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Logging.dll"
    installutil "C:\Program Files\Microsoft Enterprise Library\bin\Microsoft.Practices.EnterpriseLibrary.Security.dll"


  4. If you do not have administrator privileges to run the above scripts, then you can do a conditional compile of the Enterprise Library solution:

    Open up the EnterpriseLibrary.sln
    Modify the Configuration Properties\Build\Conditional Constants of the EnterpriseLibrary.Common project.
    Remove the USEWMI;USEEVENTLOG;USEPERFORMANCECOUNTER constants.

    These constants removed, instrumentation is now disabled. Recompile your enterprise library package and use it in your application.

Labels: ,

Monday, May 05, 2008

ORA-06502: PL/SQL: numeric or value error

If you are trying to use ODP.NET for your ASP.NET application, you may run into some compatibility with the version you are trying to use. For example, I ran into an issue trying to use the 11g provider for our Oracle 9i database server - ORA-06502: PL/SQL: numeric or value error

Resolution

Use the version release of ODP.NET that matches your database server version. We uninstalled the 11g provider and everything worked fine!

Link to ODP.NET

http://www.oracle.com/technology/tech/windows/odpnet/index.html

Labels: , , , , ,

Friday, April 18, 2008

Validator controls not working inside an UpdatePanel

I ran into a problem when validator controls would not work correctly inside an update panel and here is the reason why...

Solution: Need to download the validator control source from the CTP releases of AJAX and do some updates to the web.config to map the validator controls to this new source library and it should work ok. This will be a temporary solution until we get a .net 2.0 patch through Windows Update.

Tuesday, May 30, 2006

GridView Select All Client-Side Script

I had used a simple javascript function to check all/uncheck all items in a DataGrid. The same function can be modified to suit the new GridView in ASP.NET 2.0

  1. Create a template column and as a server-side checkbox to the ItemTemplate

  2. Create a client-side checkbox in the HeaderTemplate and double-click the item to insert a placeholder for the client-side javascript. The function is as below:

    function chkMasterApprove_onclick(aspCheckBoxID,checkVal)

    {
    re = new RegExp(aspCheckBoxID + '$') //to find the generated controlname

    for(i = 0; i < document.forms[0].elements.length; i++)

    {
    elm = document.forms[0].elements[i];

    if (elm.type == 'checkbox')

    {

    if (re.test(elm.name))

    {

    elm.checked = checkVal ;

    }

    }}
    }