Posts

Showing posts from August 30, 2009

New Features in Visual Studio 2010 and the .NET Framework 4.0

Image
Visual Studio 2008 may be better than sliced bread, but the development team at Microsoft has already been working on the next release. They have recently given us Visual Studio 2010 and the .NET Framework 4.0 as a Community Technology Preview (CTP); it boasts several features that would appeal to developers. This article won't go into every single feature, but will go into features that are the most relevant to .NET developers. Please note that because this is a CTP, it doesn't mean that the final release will be exactly as you see in the CTP or as is described here. I can go over the features roughly as follows: New Features in the Visual Studio 2010 IDE and .NET Framework 4.0 Call Hierarchy of methods A New Quick Search Multi-targeting more accurate Parallel Programming and Debugging XSLT Profiling and Debugging The XSD Designer New ASP.NET features Static IDs for ASP.NET Controls The Chart control Web.config transformation New VB.NET features

Writing to the EventLog from a Web Application

Introduction When I was a young lad in college, I wrote undetectable viral hacks, keyboard sniffers, and collected more passwords than I care to count. (Thankfully, the statute of limitations—this was 20 years ago—has run out.) I never stole anything or wrecked anyone's data, but I did encourage a young fellow to send roses to his girlfriend and hooked a football player, Napolean XXXXXXX (last name omitted), up on a blind date. I understand the allure of going and being places one isn't allowed, but this crap makes life a pain in the butt for the rest of us. I wonder whether you should hate hackers and those nitwits who tweak Trojans, so the rest of us have to keep sending money to McAfee?! I also wonder if maybe the sparring and jousting among programmers, Microsoft and hackers, and cyber thieves aren't necessary to push the technology forward, at least as far as security is concerned, so we all are protected from worse—cyber terrorists. With the economy

Outlook type Address Book in C#, LINQ, XML with Menu and ToolBar

Introduction This is a sample project to create outlook type address book with LINQ and XML. It also shows how to use menu and toolbars in your windows application. Background LINQ ( Language Integrated Query) is a Microsoft .NET Framework component that adds native data querying capabilities to .NET languages. It allows you to query collections like arraylist, List etc. LINQ to XML is a new way to construct, write and read XML data in the .NET language of the developers’ choice. This new API simplifies working with XML data without having to resort to using additional language syntax like XPath or XSLT. LINQ to XML is not a replacement for any of the current DOM’s or XML class libraries; LINQ to XML in many cases overlaps their functionality and aims to provide a superior developer experience, but existing code will continue to work. One aspect of LINQ to XML is that it supports writing Query Expressions and can be combined with any of the other LINQ technologies to cre

Using User Defined Functions in Table Inserts and Seeding with Stored Procedures

Overview This article (my first), demonstrates how to automatically set column values with INSERT statements. I show two methods: The first automatically generates a unique code on a Table INSERT using a User-defined Function; while the second uses a Stored Procedure to insert Rows into a table with specified or default index numbers. Background Do you ever need to seed index columns like task numbers or steps in a sequence? How about automatically generating a unique code for a customer? My solutions to these problems follow. These may not be the best, or most elegant ways to implement this functionality, but it is a good starter. The first thing we have to do is open SQL Management Studio (SSMS) and create a sample database named DemoTaskList ; then in a new query window, we create our first table: See full detail: http://www.codeproject.com/KB/database/UDFInserts.aspx

Very fast test data generation using exponential INSERT

Image
Introduction This article (my first) will describe an algorithm that enables a large amount of data to be generated very quickly using a SQL query. The test data can be static or incremental, such as “Item Name” and “Item ID”, respectively, as shown below: Background One of the tasks I did in a project involves generating a testing table with 103,680,000 records. The conventional method of data generation would take a month; hence, a fast method of data insertion was required. The new method took only 5 hours. Using the code Conventional method – Sequential INSERT The conventional way of generating a list of numbers from 0…100000 would be using a loop and an INSERT statement as follows: CREATE TABLE #tempTable([Item ID] [ bigint ], [Item Name] nvarchar ( 30 )) DECLARE @counter int SET @counter = 1 WHILE (@counter < 100000 ) BEGIN INSERT INTO #tempTable VALUES (@counter, ' Hammer' ) SET @counter = @counter + 1 END SELECT * FROM

SharePoint feature to extend SharePoint site with AJAX 3.5 and Telerik Rad Controls

Introduction When I started to play with Telerik Rad controls under SharePoint, I realized, that the massive changes should be made manually to web application's web.config file. Therefore the DeploymentFeature application was created. It presents the SharePoint feature, which applies all needed changes to the web application's web.config file. Moreover it installs needed dlls to the GAC. In general this application can add any modifications to the web.config, by reading them from an external XML file, which has structure similar to web.config . Moreover, since the modifications are located externally, they can be dynamically changed, without recompiling the application. Prerequisites The usage of the solution implies the SharePoint 2007 existence, which means that the target OS is Win2003 or Win2008. The source code project was created using SPVisualDev , which uses WSPBuilder for deployment. So you should download and install them from CodePlex , or deploy

Exact Phrase Website Live Search Script .NET 3.5, New 2009

Introduction My project: Exact Phrase Website Live Search Script. This script is produced with compatibility to ASP .NET 3.5 and is used in Websites, webservers, including localhost, domain.com, etc. The script primary programming is done in C#. This script is a utility which searches out the entire domain.com or the website's files: .html, .htm, .txt, .rtf, .nfo to find an exact keyword or a phrase. The search does not requires any database neighter temporary file creation or temporary space. Search is done right live into the website and the server which runs the website! In one go, in a matter of only two seconds on the Xeon server, the search completes parsing out at least 500 web pages and indexes the searched files right away. Regards, Tushar. Extended information: Put this ASP 3.5 script into yourdomain.com/ and search the entire website for exact word or a phrase. This script is based on ASP .NET 3.5 so if you have installed .NET 3.5 on your server/localhost

How to improve the performance of ASP.NET MVC web application

Introduction In this article, i will examine how you can improve the performance of an ASP.NET MVC application by taking advantage of the following components. Implementing Caching Implementing HTTP Compression Implementing JQuery UI library with Google Hosted Ajax Libraries By combining scripts and other resources Deploying production code in release mode Remove default HTTP modules in ASP.NET Implementing Caching The easiest way to implement cache on MVC view is to add an [OutputCache] attribute to either an individual controller action or an entire controller class. Here is a controller action GetWeather() that will be cached for 15 seconds. See full detail: http://www.codeproject.com/KB/aspnet/How_to_improve_performanc.aspx

Peer to Peer ASP.NET State Server

Image
Introduction ASP.NET web developers have three built in options to store session state, namely, in-process memory, SQL Server and State Server. In-process memory offers the fastest performance but is unsuitable for use in web server farms because the session data is stored in the memory of the ASP.NET worker process. SQL Server is an out of process session state storage option that works with web server farms. It stores session data in a SQL Server database. It is the most reliable option but the least performing one. One major issue with this option is that quite often developers want to cache data retrieved from a database in session state, to reduce database lookups. SQL Server session state defeats this purpose, because there is little performance gain in caching data retrieved from a database, in a database. State Server is an out of process session state storage option that works with web server farms. It stores session data in memory and delivers better perfor

Automatic Birthday Scrap to Orkut Friends Using WATiN

Introduction By using this application, Orkut users can send birthday wishes scrap to their friends without fail and even without logging into Orkut site. It is just like eliminating human interaction with website while sending birthday scrap to Orkut friends without missing nearest, dearest friend’s birthdays. Just by running this application, you can finish this work within seconds. You can set a time to run this application on a daily basis at a predefined time. Implementation You have to add this application in your control panel scheduler with some predefined time. And at the predefined time, this application will run and will do all the operations that you are supposed to do in Orkut while sending birthday scrap to your friend. :) If we run this console application, we will see an Internet Explorer browser opening and automating the entire manual process. Isn't that cool? :) Background I remember those days when I used to login in to Orkut to check for friends