Posts

Showing posts from July 26, 2009

Building a web crawler

In October’s issue I showed how to develop an HTML Container class. This month, we will use that class to develop a general purpose Web Crawler class. The HTML Container project, including a VB.NET version, can be downloaded from the VSJ web site . Before getting started you will need to add the HTML Container class (WebWagon.dll) to your project. From the menu, choose Projects|Add Reference. Click the Projects tab and then the Browse button. Navigate to the location of WebWagon.dll and click OK. A Web Crawler – sometimes referred to as a spider or robot – is a process that visits a number of web pages programmatically, usually to extract some sort of information. For example, the popular search engine Google has a robot called googlebot that sooner or later visits virtually every page on the Internet for the purpose of indexing the words on that page. We are going to develop a general-purpose class that can be used as a basis for writing any type of robot. This class wi

WebClient and HttpWebRequest class

Image
Objective: This article will discuss about, different way of consuming HTTP enabled service (like REST).This article, will explain about WebGet and HttpWebRequest. Before reading this article, I will suggest readers to read my previous articles on REST, ADO.NET Data Service and Cross Domain issue on our site. Assumption: Already REST service has been created and hosted within placed client access policy file. There is a Silverlight Client. Which is going to consume WebGet service of REST How to access HTTP based service in Silverlight? HTTP based service returned data on a HTTP request in a particular URI HTTP request can be send any type of URI like, http://trvlsdw002/synergyservices/appointmentservice.svc/Appointments/ http://b068ltrv/SynergyService/AppointmentService.svc/Appointments/Mahesh http://localhost:22947/AppointmentService.svc"/Appointments/Praveen HTTP request is cofigured to work with , verb GET Required parameter to invoke service (WebGet s

Drag and Drop in Silverlight 3 Application

Image
Introduction In this article we will see how can we implement Drag and Drop in Silverlight 3 Application. Crating Silverlight Project Fire up Visual Studio 2008 and create a Silverlight Application. Name it as DragAndDropInSL3. Open the solution in Blend 3 to design. Actually there is nothing to design but I wanted a good Panel to Drag and Drop. J I have just designed the Drag Panel. As you see in the Object and Timeline Pane I have added a Border and named it as "MyPanel" and added a Grid with a Text Block saying "Information Bar". On the property side I have filled the Border with Linear Gradient and made the Opacity to 50%. Here is the Xaml code for your reference. See full detail: http://www.c-sharpcorner.com/UploadFile/dpatra/DragAndDropInSilverlight307272009142624PM/DragAndDropInSilverlight3.aspx

Using partial class, when working with LINQ to SQL Stored Procedures

Image
Working with LINQ to SQL we often use stored procedures, written by ourselves or some other developers. In this article I will explain how you can combine using of your own classes to DataContext (dbml file) and partial DataContext class, when working with LINQ to SQL Stored Procedure. A stored procedure could be simple enough (for our understanding), but not so simple for auto-generated code (may be it's better to say, that auto-generated code just does not generate a return type, which we want to see, or just does not see/recognize, that our stored procedure return any type). For example, we have very simple table (fig. 1) Fig. 1. and some stored procedure, that we use for getting one or all records from this table: ALTER PROCEDURE dbo.usp_Site @Site smallint = -999 AS select SiteNum, SiteName, LastUpdate from dbo.NC_Site where SiteNum = case

ScrollViewer control in Silverlight 3

ScrollViewer control in Silverlight 3 Imagine that you just clicked a picture with a digital camera or cellphone. Now you decide to create an image for it using the Image control of Silverlight 3. But if your image is really large (most cameras and cellphones these days offer great megapixel capabilities) then the Image control alone would not be sufficient to display the content of the picture. Because when the image is rendered, only part of it would be visible in the UI. To be able to see the image in its entirety, you need a control that can allow you to scroll, either horizontally, or vertically or in both directions. Luckily for you, such a control is provided by Silverlight 3 and is named as the ScrollViewer control. This control in Silverlight 3 enables you to scroll through its child controls, which could be an Image or a TextBlock or any such UI control. The ScrollViewer control provides support to include a HorizontalScrollBar and/or a VerticalScrollBar. You c

Dragging and dropping with ASP.NET 2.0 and Atlas

Image
Introduction This tutorial is intended to help readers understand how certain aspects of Microsoft's new AJAX Extensions technology works. AJAX Extensions is intended to simplify the development of AJAX-style functionality. As with all technologies, however, to use a tool well, it is important to understand the underlying technology that Atlas abstracts. One of the key ASP.NET AJAX abstractions is the new XML markup syntax developed to make coding with AJAX easier (originally included with the core Atlas files, XML markup is now a part of the CTP called AJAX Futures). With XML markup, developers can modify their code declaratively. However, there are times when a developer may want to be able to change her code programmatically, and in order to accomplish this, she will need to understand that underneath the markup abstraction, she is actually dealing with good 'ol JavaScript and some custom JavaScript libraries developed by Microsoft. In order to demonstrate the

Atlas Tutorial: Creating an AJAX Scribble application

Image
Please read instructions at the end of article on how to run the application after downloading the source. Introduction ASP.NET Atlas is a rich set of client side and server side libraries to develop AJAX-style applications using ASP.NET. This tutorial (and probably more in this series) attempts to provide a general view of the features available in Atlas. Since, Atlas is a very vast library this very first tutorial concentrates on two most important features of Atlas: Ability to call server side web services from client side scripts Ease of developing cross-browser compatible JavaScript code Background MFC Scribble application was one of the first application that I used to learn MFC. Therefore, I decided to base this tutorial on Scribble. Scribble application allows users to draw freehand sketches using the mouse. I first saw a similar application on the web, utilizing AJAX technologies, at the JavaScript Draw website. The JavaScript draw website works only o