Wednesday, December 14, 2011

Replace in sql

REPLACE ( string_expression , string_pattern , string_replacement )

Monday, December 5, 2011

Charindex in sql

SET @FullName = 'www.java2s.com'
SET @SpaceIndex = CHARINDEX('java', @FullName)
SELECT LEFT(@FullName, @SpaceIndex - 1)

Substring in sql

SELECT x = SUBSTRING('abcdef', 2, 3)

Friday, December 2, 2011

Learning asp.net 4.5

Radio button with gridview asp.net

Hi Ther,

We are facing many problems with including radio button with grid
one of them is all are selected because they are generating different name in html
to overcome we have to do the following then its easy.

in html code we have to assign its checked chang event and in code back we have to write the code like this

     foreach (GridViewRow row in gridViewProducts.Rows)
   {
    ((RadioButton)row.FindControl("radioButtonToSelectTheProductResult")).Checked = false;
   }
   var radioButton = (RadioButton)sender;
   radioButton.Checked = true;

then what we are doing here is setting first all check box to false and then the one who is sender to true.

by default with radio we are giving customer to select one, we are not allowing to deselect all.
so one who is clicked is already selected in grid.

It is working correctly there.

Engjoy radiobutton with gridview

Thanks & Regards
Nipam Budhabhatti