Thursday, October 3, 2013

how to access footer row in databound of a gridview

To access the footer row in a gridview in asp.net/vb.net,
write the following in row databound

VB Code
If e.Row.RowType = DataControlRowType.Footer Then
     Dim lbl As Label = DirectCast(e.Row.FindControl("lbl"), Label)
     lbl.Text = Total
End If

how to replace the text in a string using sql

To replace particular text in a selected string using sql statement,
write the following query

SELECT REPLACE('SQL-SERVER','-','')

Result
SQLSERVER

Wednesday, October 2, 2013

how to filter a dataset or datatable based on a condition

To filter a dataset or datatable based on a condition, use datarow

Dim dr1() As DataRow = SqlDS.Tables(0).Select("name='Test'")