Saturday, December 24, 2005

Which is best ASP.Net or PHP

Nowadays, there are lot of options to develop Web application, but selecting the right language is important.
Comparing
ASP with MSSQL 2000
PHP 5 with MYSQL
ASP.Net with MSSQL 2000

For small applications
PHP is much faster than ASP.NET, beacuse PHP interprets all of its code inside the PHP program itself, and since it is not accessing any other outside sources like COM objects, etc. It can produce a page in about 1/8 the time as a ASP.NET page can.

For Large applications
ASP.Net with SQL server is much faster than PHP with MYSQL and PHP and Oracle. More over the source code written for ASP.Net can be ported to windows application with minimal changes, but it is not possible with PHP.

Writing code to connect retrive data from a table is much complex in ASP or ASP.Net when compared to PHP but, People developing ASP.Net through Visual Studio, it is as easy as button click.Though PHP has Cross-platform ability even from the beginning. .Net will soon get Cross-platform ability (Mono for Apache).

Applications develped in ASP.Net is much secure than PHP.

So ASP.Net is suitable for Enterpise appliactions and not to small appliactions.

For more imformation: http://www.oracle.com/technology/pub/articles/hull_asp.html

Friday, December 23, 2005

When Webservices Go Bad

Client/server technology isn't a new idea. It has been around for decades, and the model has seen a resurrection under the label of Web 2.0. Now everyone calls it web services.

They're great when they are available. Anywhere the user goes, the application is sure to follow. When they go away, as Salesforce.com did for its customers for several hours recently, the reason why client/server comes and goes becomes apparent.

18,700 customers of the hosted CRM service found themselves without application availability for over eight hours. Salesforce.com blamed a faulty database for the issue while repairing the service. A failover that is supposed to take place when this happens to keep the service running didn't happen.

In the report from Silicon.com, Salesforce apologized for the problem, and noted they have greater than 99 percent uptime. Some customers cited in the article disagreed, claiming monthly outages of an hour or longer occur regularly.

The problem comes down to infrastructure. A business has to have multiple instances of its web service available, lots of redundancy, to be able to stand behind claims of reliability.

Without that redundancy, web services can and do go away, especially as more users crowd into the system. Six Apart had that problem recently with its Typepad blogging service, a problem that persisted for months.

Web services may offer alternatives to PC-based applications, but until they reach a point of reliability greater than 99 percent, Microsoft doesn't have any reason to worry about its desktop businesses, especially Office.


Read this Article in a site. Just want to share it.

ASP.NET ATLAS

ASP.NET “Atlas” is a package of new Web development technologies that integrates an extensive set of client script libraries with the rich, server-based development platform of ASP.NET 2.0. “Atlas” enables you to develop Web applications that can update data on a Web page by making direct calls to a Web server — without needing to round trip the page. With “Atlas”, you can take advantage of the best of ASP.NET and server-side code while doing much of the work in the browser, enabling richer user experiences.

“Atlas” enables you to build applications with better performance than traditional Web applications in two key aspects — responsiveness and user interface (UI). Traditional Web applications require a round trip for updating data or controls, which can result in long waits. “Atlas”, on the other hand, dramatically improves application performance by reducing the need for round trips.

In addition, since “Atlas” performs much of the processing in the client, it enables you to build a richer UI giving users a superior user experience over traditional Web applications. Not only does “Atlas” give you the power to create all the controls and features users have come to expect from a rich UI (such as drag and drop, auto-completion, mouse hovering behavior, and more), but more importantly, it enables you to build interactive, data-bound controls that allow users to sort, update, or change their view of data with few or no round trips to the server.

While ASP.NET “Atlas” is both a new package of technologies and a new approach, it is consistent with the concept of developing applications using Asynchronous JavaScript and XML (AJAX). ”Atlas” applications are cross-platform and will run with little or no change in any modern browser. Examples of “Atlas” style applications include Microsoft's Virtual Earth site, Microsoft's Outlook Web Access e-mail client, and Start.com.

Creating AJAX-based Web applications is complex and requires extensive knowledge of client script. Thus, “Atlas” is not merely another implementation of AJAX. Instead, “Atlas” extends the AJAX concept in two significant ways. First, the “Atlas” client script libraries dramatically simplify the tasks of creating rich UIs and remote procedures calls by providing you with true object-oriented APIs and components for Atlas development. Second, “Atlas” extends the AJAX concept by providing a rich, integrated server development platform in ASP.NET 2.0. The “Atlas” server components include ASP.NET Web services and server controls that enable you to take advantage of the power of ASP.NET, such as the ASP.NET profiles service, in an “Atlas” application.

Overall, "Atlas" is about simplifying AJAX development and incorporating AJAX concepts into the typical Web application development process. The ASP.NET “Atlas” package of client and server-side development tools and components is a significant evolution and enhancement of the AJAX concept. The PDC materials — the Hands-On Labs, the “Atlas” QuickStart tutorials, and the keynote addresses — will help you to discover the power of the “Atlas” concept and its potential to transform the way you build Web applications.


To know more about ATLAS: http://www.asp.net/default.aspx?tabindex=7&tabid=47

Download Visual Studio Express Editions

Microsoft has come up with free VS.Net 2006 Exp Edition download including MSDN help. Visual Studio Express editions are free for one Year.

Link : http://msdn.microsoft.com/vstudio/express/default.aspx

Monday, December 19, 2005

Prevent Sql Server Locks

Most of the time we write query in different databases, but we are not sure whether it affects any performance of the database. Lets see how to prevent SQL server table locks.

Tables that change little, if at all, such as lookup tables consider altering the default lock level for the table.

You can override how SQL Server performs locking on a table by using the SP_INDEXOPTION command. Below is an example of code you can run to tell SQL Server to use page locking, not row locks, for a specific table:

SP_INDEXOPTION 'table_name', 'AllowRowLocks', FALSE
GO
SP_INDEXOPTION 'table_name', 'AllowPageLocks', FALSE
GO

This code turns off both row and page locking for the table, thus only table locking is available.

One way to help reduce locking issues is to identify those transactions that are taking a long time to run. The longer they take to run, the longer their locks will block other processes, causing contention and reduce performance. The following script can be run to identify current, long-running transactions. This will provide you with a clue as to what transactions are taking a long time, allowing you to investigate and resolve the cause.

SELECT spid, cmd, status, loginame, open_tran, datediff(s, last_batch, getdate ()) AS [WaitTime(s)]FROM master..sysprocesses pWHERE open_tran > 0AND spid > 50AND datediff (s, last_batch, getdate ()) > 30ANd EXISTS (SELECT * FROM master..syslockinfo l WHERE req_spid = p.spid AND rsc_type <> 2)

This query provides results based on the instant is runs, and will vary each time you run it. The goal is to review the results and look for transactions that have been open a long time. This generally indicates some problem that should be investigated.

In order to reduce blocking locks in an application, you must first identify them.

Once they are identified, you can then evaluate what is going on, and perhaps be able to take the necessary action to prevent them. The following script can be run to identify processes that have blocking locks that occur longer than a time you specify. You can set the value used to identify blocking locks to any value you want. In the example below, it is for 10 seconds.

SELECT spid, waittime, lastwaittype, waitresourceFROM master..sysprocessesWHERE waittime > 10000 -- The wait time is measured in millisecondsAND spid > 50 -- Use > 50 for SQL Server 2000, use > 12 for SQL Server 7.0

This query measures blocking locks in real-time, which means that only if there is a blocking lock fitting your time criteria when you this query will you get any results. If you like, you can add some additional code that will loop through the above code periodically in order to more easily identify locking issues. Or, you can just run the above code during times when you think that locking is a problem.

The original link is http://www.sql-server-performance.com/reducing_locks.asp

Tuesday, December 13, 2005

.Net Interview questions

The following are the .Net interview questions that is beeing asked commonly in most of the companies.


.Net
ASP.NET
Winforms
Remoting
Framework Faq
C# and VB.Net

Monday, December 12, 2005

Open/Save dialog Asp.net

Mostly when we try to export a grid to Excel, the excel file will open in the same window. The following code will open the excel file in new window.

Visual C# .NET Code // Identify the file to download including its path.
string filepath = DownloadFileName;

string filename = System.IO.Path.GetFileName(filepath);
Response.Clear();
Response.ContentType = "application/octet-stream";
Response.AddHeader("Content-Disposition", "attachment; filename=" + filename);
Response.Flush();
Response.WriteFile(filepath);


Tuesday, December 06, 2005

Custom navigation Controls

Download source files - 48.3 Kb

Introduction
This is a control which will help to generate Tabs , Menus, Slider bars, and Tree views. Just in time dynamically from XML.

Background
We see many web pages with lots of controls. Most of the controls available in the market are quiet expensive and they do only one work (if it is a menu control we cant use for tab). This control has all the built in features including the security. For example, the user may want some of the items in the tab should be visible to a particular set of users say administrators and some less important to the common users. In that case this plays a important role.This control is very easy to use. The control exposes some public properties to set the data, look 'n' feel and events for the panel. By setting these properties, the collapsible panel can be used to group information very nicely.

ASP.Net Drag and Drop

Download source files - 17.5 Kb

This is a control that will help you to make pages that can be customized by the users. The control exhibits similar properties like My MSN Drag n Drop.

I have seen many people posting their queries for the drag and drop feature like My MSN. Some of them have also posted that Microsoft is doing some thing with .armx extension. I don't know what Microsoft is doing. But here I have overridden the System.Web.UI.WebControls.Panel class.
This control is very easy to use