Wednesday, March 25, 2009

வருத்தப்படாத வாலிபர்கள் சங்கம்

வடிவேலுவின் திரைப்படத்தில் வரும் “வருத்தப்படாத வாலிபர்கள் சங்கம்” என்பதே இதன் விரிவு. யாருடைய மனமும் நோகாமல் தன்னைமட்டுமே வருத்திக்கொண்டு  மற்றவர்களை சிரிக்க செய்யும் வடிவேலுவின் பாணியே இவர்களின் பாணியும்.

 

யார் மனதையும் புண்படுத்தாமல் நகைச்சுவை இழையோட வரும் பதிவுகள், மாதம் ஒரு பதிவரை அட்லஸ் வாலிபராக்கி அவருடைய நகைச்சுவை ரசனையை அனைவருக்கும் வெளிப்படுத்துவது என்பவை சிறப்பு.

 

வ.வா.சங்கக் கூட்டுப்பதிவு நகைச்சுவைக்கெனவே ஆரம்பிக்கப்பட்டது.வெற்றிக்கரமான இரண்டாம் ஆண்டுவிழாவினைக் கொண்டாடிக்கொண்டிருக்கிறார்கள். இரண்டு போட்டி , ப்ரம்ம ரசம் போட்டி போன்று அவ்வப்போது நடக்கும் போட்டிகளெல்லாம்  வாசகர்களின் நகைச்சுவை ரசனையை ஊக்கப்படுத்துகிறது.

 

 

 

 

வ.வா.சங்கத்தில்  இருக்கும் சிங்கங்களில் கைப்புள்ளையையோ இல்ல அங்கே அப்பரண்டிசா இருக்கறவங்களையோ அவர்களே கலாய்த்துப் (கிண்டலடித்து) போடப்படும் பதிவுகள் நிஜ கைப்புள்ளை வடிவேலுவையே கவர்ந்த விசயங்களாகும்.உங்களுக்காக இரண்டு உதாரணச்சிரிப்பு வெடிகள்.

 

 

1.அண்ணே, அண்ணே உங்களுக்கு மூத்திர சந்தில் இருந்து போன் வந்திருக்கு

கைப்புள்ள : கட்டதுரை கட்ட்ட்ட்ட்ட்ட துரை பார்த்தியா என் ரேஞ்ச…நான் ஒன்னும் வேலை வெட்டி இல்லாதவன் இல்லை, அங்கங்கே அப்பாய்ன்மெண்ட் கொடுத்து…அடிவாங்க போன் போட்டு கூப்பிட்டு கொடுக்கிறானுங்க, நான் அவ்வளவு பிசி…. உன்னிய மதிச்சி 2 அரைவாங்கினது நான் உனக்கு கொடுத்த மரியாதை…காப்பாத்திக்க…

 

2.ஆமாங்க கடைசி ஓவர்ல்ல ஆறு பாலுக்கு முப்பது ரன் இருந்துச்சு… அப்போ எங்க கோச் வந்து காட்டுக் கத்தலா அடிச்சு ஆடுறா கொய்யா…. அடிச்சு ஆடுறா கொய்யா…..அப்படின்னு உசுப்பு ஏத்துனார்”

“சுத்திப் பாத்தேன்… நான் அடிக்கிற அளவுக்கு யாரும் பக்கத்துல்ல இல்ல… எதிரி டீம்ல்ல எல்லாருமே வாட்டச் சாட்டமா இருந்தாங்க.. யோசிச்சேன்… யார் அடிச்சாலும் சும்மா அசால்ட்டா தாங்குற ஒரே மனதைரியம் கொண்ட ஒப்பற்ற மனுசன்.. எங்கத் தல தான் அதான் வேகமா ஓடிப் போய் பெவிலியன்ல்ல குறட்டை விட்டு தூங்கிட்டு இருந்த எங்கத் தல கன்னத்துல்ல பளேர்ன்னு ஒரு அரை விட்டுட்டு வந்து ஆடுனேன்… நாங்க செயிச்சுட்டோம்.. ஆனா எங்கத் தல கண்ணீர் விட்டு அழுததை டிவியிலே திரும்ப திரும்ப பாக்கும் போது தான் மனச் சங்கடமாப் போயிச்சுங்க”.சங்கத்தச் சிங்கங்களைச் சந்திக்கலாம் வாங்க.

Wednesday, March 18, 2009

dropdown list in gridview in asp.net2.0

I wrote this article sometime ago in response to a query asked by a dotnetcurry.com viewer. The user had a requirement where he had two dropdownlist in the GridView and the second one was to be populated at runtime based on the selected value of the first dropdownlist – A case of cascading dropdownlists.
Here’s an approach I followed without using a single line of code. We will be using the Categories and Products table of the Northwind database to show the cascading effect.
Viewers, who have prior experience in configuring the SqlDataSource, can jump directly to Step 5:
Step 1: Open VS 2008. Click File > New > Website. Choose ASP.NET Website from the list of installed template, choose target platform as .NET Framework 3.5, choose the desired language and enter the location where you would like to store the website on your FileSystem. I have created a folder called VS2008 Projects, so the location over here is C:\VS2008 Projects\ CascadingDropDownInGridView. After typing the location, click OK.
Step 2: Open Default.aspx. Switch to the Design mode of Default.aspx. Open the toolbox (Ctrl+Alt+X) > Data Tab > Drag and drop a SqlDataSource control on to the form. Click on the smart tag or right click SqlDataSource > Show Smart Tag > ‘Configure Data Source’ wizard. Click on ‘New Connection’ to open the ‘Add Connection’. Type your ‘Server Name’ and ‘Select a database Name’ to connect to. Over here, I have used (local) as the ‘ServerName’ and the database I am connecting to, is Northwind. Click on ‘Test Connection’ to make sure that there are no errors while connecting to the server. Click Ok.
Step 3: In the ‘Configure Data Source’, click ‘Next’. An option will be displayed to save the connection string to the configuration file. Select the checkbox ‘Yes, save this connection as:’, type a name for the connectionstring ‘NorthwindConnectionString’ and click Next.
Step 4: In the ‘Configure Select Statement’ > select ‘Specify Columns from Tables or Views’ radiobutton > Select ‘Categories’ table in the Name and choose CategoryID, CateogoryName as columns. Click Next > ‘Test Query’ to preview data > click Finish. The wizard adds a SqlDataSource control to the page as shown below.
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">

If you check your web.config, the connection string is added as shown below:



Step 5: Now add a GridView control to the page. We will add a BoundField and a TemplateField to display the CategoryID and CategoryName’s respectively. The TemplateField will contain our first dropdownlist displaying CategoryNames.



ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">


DataKeyNames="CategoryID" DataSourceID="SqlDataSource1">

InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" />



DataTextField="CategoryName" DataValueField="CategoryID"
DataSourceID="SqlDataSource1" runat="server" AppendDataBoundItems="true"
SelectedValue='<%# Bind("CategoryID") %>' />









Note: The SelectedValue='<%# Bind("CategoryID") %>' helps us select the CategoryName in the dropdownlist in accordance with the CategoryID, when the page is first loaded.
Step 6: So far so good. We now have to add the second dropdownlist whose values will be determined at runtime depending on the value selected in the first dropdownlist. In our case, when the user will select CategoryName in the first dropdown, corresponding Products will be displayed in the second dropdown.
Add another Template Field (with a second dropdownlist) in the GridView as well as one more SqlDataSource. This time the SqlDataSource2 will be bound to the ‘Products’ table. Moreover, the ‘SelectCommand’ of the SqlDataSource will accept a parameter, which will be the selected category. Let us see the markup for the same:


DataTextField="ProductName" DataValueField="ProductID"
DataSourceID="SqlDataSource2" runat="server" />
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], CategoryID FROM [Products]" FilterExpression="CategoryID = '{0}'">

PropertyName="SelectedValue" />




Notice the element used as a child of the SqlDataSource2. This element is worth observing over here. The is a very handy feature of the SqlDataSource control especially when you have a requirement of filtering the results of a query based on a value that is known only at run time. So without making another roundtrip to the server, you can filter out the data that is made available by the SqlDataSource. All you have to do is to create filter expressions that contains parameter placeholders. So for each filter parameter placeholder, you use a parameter element.
In our case, we have created a filter parameter that gets its value from a DropDownList control.
Well that’s all the markup that is required to create cascading dropdownlist in a gridview. Run the application and you can now test the functionality of populating the second dropdownlist based on the selected value of the first dropdownlist. The application will look similar to the image below:

The entire markup is as shown below:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>





Cascading DropDownList In GridView





ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [CategoryID], [CategoryName] FROM [Categories]">


DataKeyNames="CategoryID" DataSourceID="SqlDataSource1">

InsertVisible="False" ReadOnly="True" SortExpression="CategoryID" />



DataTextField="CategoryName" DataValueField="CategoryID"
DataSourceID="SqlDataSource1" runat="server" AppendDataBoundItems="true"
SelectedValue='<%# Bind("CategoryID") %>' />





DataTextField="ProductName" DataValueField="ProductID"
DataSourceID="SqlDataSource2" runat="server" />
ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT [ProductID], [ProductName], CategoryID FROM [Products]"
FilterExpression="CategoryID = '{0}'">

PropertyName="SelectedValue" />














I hope this article was useful and I thank you for viewing it.

Wednesday, March 4, 2009