Sunday, August 31, 2008

http://Localhost - No web site is configured at this address

Hi,

When you trying browse http://localhost, do you see the message, "No web site is configured at this address". I also saw the same message today and was trying all tricks to solve it for 20 - 30 mins untill i found this helpful blog. Here are points mentioned and I made sure all are done as mentioned below(updated with my attempt);

I am using OS: XP pro & IIS V5.1.

Note: Y= checked on, N= not checked.

Website Identification: Running, Host header name: blank,IP Address (SELECT All Unassigned) port: 80

WEB SITE
HTTP keep alive enabled : Y
Enable logging: Y

ISAPI FILTERS: blank

HOME DIRECTORY:
content should come from: A Directory on this computer :Y
Local path: c:\inetpub\wwwroot (which I have shared through explorer: share folder on network:Y, Allow users to change files: Y)

Script source access: N
Read: Y
Write: N
Dir browsing: N
Log Visits: Y
Index resource: Y

application setting:
Application name: Default Application
Execute Permissions: Scripts Only
Application protection: Medium(pooled)

DOCUMENTS:
enable default document: Y
(I have added my Login.aspx here(and all other website files) to the inetpub/wwwroot directory)
enable document folder: N

HTTP HEADERS:
enable content expiration: N

DIRECTORY SECURITY:
ANONYMOUS ACCESS & AUTHENTICATION CONTROL: (EDIT)
anonymous access: Y
User name: SOMESTATION\IUSR_SOMESTATION (SOMESTATION being my computer name)
allow IIS to control password: Y
basic authentication: N
Integrated Windows Authentication : N

I Believe after making highlighted change (Select: All Unassigned) only it worked fine for me.

Regards
Fauzi

Failed to access IIS metabase.

Hi,

Here is the solution for the error "Failed to access IIS metabase." which occurred in my case when i was trying to access a web application first time after installation of IIS (Version 5.1) in my XP pro.

In command prompt, go to the location:
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

Run, aspnet_regiis -i

This will install asp.net 2.0. & web application works for me now :)

[Update]
At times ASPNET account may not have permission to access IIS metabase.
The following command has to be executed;

aspnet_regiis -ga ASPNET

Hope this should be helpful :)

Regards
Fauzi

Friday, August 22, 2008

SQL Server 2005 Management studio missing after New Installation

Hey all...

I wannu blog this for a long time... I have faced this problem many times after installation. I have installed SQL Server 2005 Enterprise edition on Windows 2003 Server and SQL Server 2005 Developer edition on Windows XP professional edition.
In both the cases when I installed SQL server 2005, SQL Server Management Studio was missing after successful installation. The simple solution is you need to uninstall it and reinstall the setup again. When I goggled for it many of them suggest the same solution, still wondering what could be the cause? Any ways it works now :)

Note: Remember to delete all the left over folders after uninstalling the software before re-installation.

Regards
Fauzi

Thursday, August 21, 2008

SQL SP without Cursors for Row by Row Operations

Hi...

As everyone now's we can use Cursors for row-by-row operations in SQL Stored procedures. The drawback of using this option is Performance. So to overcome the issue we can write a work around code to implement row-by-row operations in your SQL stored procedure. Following are the code written for this with appropriate comments to explain its operation.

BEGIN

-- Here we Initialize variables

DECLARE @iNextRowId int,@iCurrentRowId int,@iLoopControl int,@FundID int, @FundIndexId int

SELECT @iLoopControl = 1

SELECT @iNextRowId = MIN(ID)FROM Fund_Index_Relationship Where Fund_ID = @ID

-- Retrieve 1st row

SELECT @iCurrentRowId = ID,

@FundID = @ID,

@FundIndexId = FundIndex_ID

FROM Fund_Index_Relationship

WHERE ID = @iNextRowId AND Fund_ID = @ID,

-- Your Code Logic Starts

-- Code...

-- Your Code Logic End

-- Loop is started

WHILE @iLoopControl = 1

BEGIN

SELECT @iNextRowId = NULL

-- Getting next ID

SELECT @iNextRowId = MIN(ID)

FROM Fund_Index_Relationship

WHERE Fund_ID = @ID AND ID > @iCurrentRowId

-- check whether there is a ID next

IF ISNULL(@iNextRowId,0) = 0

BEGIN

BREAK

END

-- Your Code Logic Starts

-- Code...

-- Your Code Logic End

-- get the next row.

SELECT @iCurrentRowId = ID,

@FundID = @ID,

@FundIndexId = FundIndex_ID

FROM Fund_Index_Relationship

WHERE ID = @iNextRowId

END

END

Friday, August 8, 2008

Solution for Operation Aborted message in openflashchart 1.9.7 for IE

Hi...

I am using openflashchart 1.9.7 an open source chart generation tool (url) for graphical presentations in my application. It really has a nice look & feel which is more presentable. I made use of it & created awesome charts in my application. The Graph work well in Firefox but the same page in IE 7.0 was showing Operation aborted error.
I was puzzled & was pretty much sure that there was nothing wrong in the code. So its time to dig into the open source control... It was in Chart.cs the Codes written specific to IE was the reason. I checked it with my friend, a flash programmer who said there needs to be a DIV tag which has to come above the existing DIV added for I.E.

Following is the Code to be added in RenderContents Method in Chart.cs


if (this.SequenceId == 0)
{
output.WriteLine(string.Format("<script type=\"text/javascript\" src=\"{0}/aspnet_client/OpenFlashChart/js/swfobject.js\"></script>", HttpRuntime.AppDomainAppVirtualPath));
}

if (this.SWFObject)
{
output.WriteLine(string.Format("<div id=\"{0}\" >", this.ClientID));
output.WriteLine("</div>");
//output.WriteLine(string.Format("<div id=\"{0}\" />", this.ClientID));
output.WriteLine("<script type=\"text/javascript\">");
output.WriteLine(string.Format("var so = new SWFObject(\"{0}/aspnet_client/OpenFlashChart/open-flash-chart.swf\", \"ofc\", \"{1}\", \"{2}\", \"9\", \"#FFFFFF\");", HttpRuntime.AppDomainAppVirtualPath, this.Width, this.Height));
output.WriteLine(string.Format("so.addVariable(\"width\", \"{0}\");", this.Width));
output.WriteLine(string.Format("so.addVariable(\"height\", \"{0}\");", this.Height));
output.WriteLine(string.Format("so.addVariable(\"data\", \"{0}\");", this.Url));
output.WriteLine("so.addParam(\"allowScriptAccess\", \"sameDomain\");");
output.WriteLine(string.Format("so.write(\"{0}\");", this.ClientID));
output.WriteLine("</script>");
output.WriteLine("<noscript>");
}

Built the project & replaced the new dll & now the chart works fine in IE too :)

Regards
Fauzi

Exclude pages from authentication in ASP.Net

Hi...

I have implemented Asp.Net Membership Management in my current application. There are some pages which is going to be displayed on the clients website for anonymous users. So for these pages I have made sure that i am not using session variables which i used in other pages. I have excluded the page from Master page hoping that it would not require authentication. But that will not work. Actually we need to specify the respective page or folder in web.config saying that the authorization is anonymous. Following are the nodes to be placed under Configuration node in Web.Config file.

<location path="Your-File.aspx">
<system.web>
<authorization>
<allow users="*">
</allow>
</authorization>
</system.web>
</location>

Or

<location path="Your-Folder">
<system.web>
<authorization>
<allow users="*">
</allow>
</authorization>
</system.web>
</location>

Or

<location path="Your-Folder/Your-File.aspx">
<system.web>
<authorization>
<allow users="*">
</allow>
</authorization>
</system.web>
</location>

[Updated] Note: Please remember to add your Images folder, Styles.css and other common files & folders which is used inside the nodes as shown above.

Now it is a stand alone page & it works fine...

Regards
Fauzi ~ Olympics fever has started :)