Are namespaces and Class names Case Sensitive
Namespaces and Class names are case Sensitive. Namespaces imported using the @ Import Directive will cause an error if the correct case is not used.
How to get the DataField name of a BoundColumn from code-behind
Try [VB.NET] Dim bc As BoundColumn = CType(Me.DataGrid1.Columns(1), BoundColumn) Response.Write(bc.DataField) [C#] BoundColumn bc = (BoundColumn)this.DataGrid1.Columns[1]; Response.Write(bc.DataField);
How to validate that a string is a valid date?
VB.NET Dim blnValid As Boolean = False Try DateTime.Parse(MyString) blnValid = True Catch blnValid = False End Try C# bool blnValid=false; try { DateTime.Parse(MyString); blnValid=true; } catch { blnValid=false; }
How to check if the ArrayList is empty
VB.NET if arrList= 0 then .. else .. end if C# if (arrList ==0) { … } else { … }
How to hide and show a Column based on the authenticated user
In the DataGrid_ItemDataBound Event write the following code VB.NET If Not User.Identity.IsAuthenticated Then e.Item.Cells(1).Visible = False End If C# if ( ! User.Identity.IsAuthenticated ) { e.Item.Cells[1].Visible =false; }