Thursday, June 24, 2010

Retrieve columns from other table without using INNER JOIN!

Hi,

Here, I'm going to tell you how to retrieve the columns from multiple tables in a single SELECT query. Can't you understand properly? OK. I'll brief you here. I've created two tables. They are, TABLE1 and TABLE2 . Each has two columns. Usually what we will do to select these two tables columns? We'll use INNER JOIN over here.

You can achieve this without using INNER JOINs. Look at this figure!

Thursday, June 17, 2010

LinQ

Hi,

This article will give you the knowledge about the LinQ which stands for Language Integrated Queries . LinQ is one of the new features of .Net 3.5. It offers some operators which help us to write SQL queries in C# syntax. Now I'll show you with a simple example.

In order to build a query in LinQ, we must use var keyword which is an enumerable type. It holds the output returned by Linq statement. Have a look at this.



var nameList = from name in ListOfNames select name




Here, nameList is an enum type which accepts the name list from the ListOfNames collection. It may be an ArrayList or a List<String> or any kind of Collection.

LinQ with Arrays

Hi,

In this article, I'm going to tell you how to generate a select query with where clause and filtering from the array using LinQ. Usually in SQL, we have to write like this.

select name from names where name like 'A%'

This will produce the names whose name start with the character of 'A'. Similarly, we can perform such a way using LinQ. Look at this pictorial sample.



Here, the query returns Monday because, I've used dy.Last() method which returns the last string from the sorted list. You can also retrieve the first occurrence of the string from the arrays using dy.First() .

Wednesday, June 16, 2010

Find Control In RowCommand Event Handler

This article will give you how to find a control which belongs to the gridview using RowCommand event handler. It quite easy to do this. Look into the code fragmentation.

//Find the hidden control which is present in the Gridview.

HiddenField attemptIdHiddenField = (e.CommandSource as ImageButton).Parent.
FindControl("CreateTestSession_attemptIdHiddenField") as HiddenField;


The reason for using ImageButton is, we've an ImageButton and the HiddenField control in the same row (i.e. ). If the ImageButton is clicked during the run time, that will be considered as a command source.

We can also have different controls in the same row such as Button, LinkButton and so forth. In this case, we need to validate command source that is, who is called the event like Button, LinkButton or an ImageButton. The code like this.

if (e.CommandSource is ImageButton)
// Do something

if (e.CommandSource is Button)
// Do something

if (e.CommandSource is LinkButton)
// Do something

Sunday, May 2, 2010

How to disable visual 'dots' in Visual Studio?

Accidentally or by mistake, we can press CTRL+E,S shortcut key when we work in Visual Studio text editor. What will happen when this is done? Look at this screen shot.



The page seems to be awkward and uncomfortable to work. So, how can we remove this? See this figure.

Thursday, February 11, 2010

DotNetNuke - In New Era

DotNetNuke is an open source web content management system which is often abbreviated as WCM or CMS. It is mainly used to develop web based applications with interactive appearance with user friendly. Finally, it is integrated with Microsoft.Net and deliver rich web based business applications/web sites. DotNetNuke has several features as follows:

  • Powerful
  • Easy to Use
  • Scalable

Google's New Baby - Google Buzz

Hi,

Google has launched a fantastic application called Google Buzz. It's also similar to social networking applications such as Facebook,Twitter and so forth. There, we can share photos, chats, image messages and status update information etc. It is incorporated with Gmail.