Local variable
Jeena Yahan Marna Yahan,
Iske siva Jana kaahan.
Global variable
Musafir hoon yaaron,
na ghar hai na thikana
The debugger
Jab koi baat bigad jaye
Jab koi mushkil pad jaye
Tum dena saath mera hamnawaz
Reference site for Sitecore and Dot NET. Call at +91-9910045174 for any Sitecore corporate trainings and workshops.
Surendra Sharma
Search This Blog
Wednesday, May 5, 2010
Grid with line numbers
<columns>
<asp:templatecolumn
ID="templatecolumn1"
runat="server"
headertext="Row Number">
<asp:templatecolumn
ID="templatecolumn1"
runat="server"
headertext="Row Number">
<itemtemplate>
<span><%# Container.ItemIndex+1 %></span>
</itemtemplate>
</asp:templatecolumn>
</columns>
Datagrid Sort Example
void MyDataGrid_Sort(Object sender, DataGridSortCommandEventArgs e) {
SortField = (string)e.SortExpression;
BindGrid();
}
DataView dv = new DataView(dt);
dv.Sort = SortField;
return dv;
Tuesday, May 4, 2010
To get month name from datetime picker in VB.NET
dim str as string=MonthName(dtpAttendance_Date.Value.Month)
To get month name from datefield of a Table in SQL
SELECT DATENAME(month, getdate()) AS 'Month Name'
Command for Redirecting all the file of a folder in a reverse order of Datewise.
D:\> dir *.cs /B /O-D>C:\abc.txt
To Convert variable of one datatype to other in SQL.
DECLARE @mybin1 binary(5), @mybin2 binary(5)
SET @mybin2 = 0xA5
-- No CONVERT or CAST function is necessary because this example concatenates two binary strings.
SELECT @mybin1 + @mybin2
-- A CONVERT or CAST function is necessary because this example concatenates two binary strings plus a space.
SELECT CONVERT(varchar(5), @mybin1) + ' ' + CONVERT(varchar(5), @mybin2)
-- Here is the same conversion using CAST
SELECT CAST(@mybin1 AS varchar(5)) + ' ' + CAST(@mybin2 AS varchar(5))
Subscribe to:
Posts (Atom)