Home » 2008 » December

What is the global keyword in CSharp?

During the Christmas break, I received the following question:

What does C# global keyword actually do? Code example, from table adapter code:

[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")]
[global::System.Serializable()]
[global::System.ComponentModel.DesignerCategoryAttribute("code")]
[global::System.ComponentModel.ToolboxItem(true)]
[global::System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema")]
[global::System.Xml.Serialization.XmlRootAttribute("AutoTwitDataSet")]
[global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")]
public partial class AutoTwitDataSet : global::System.Data.DataSet {

Continue reading “What is the global keyword in CSharp?”

GridViews – Multiple Rows Per Record

G04B0069 I don’t know about you, but I’ve had several occasions where I’ve needed to use the simplicity of the GridView control in ASP.NET.  DataBinding, Paging, Sorting, etc.  But I’ve also wanted to stack the information for a record in multiple rows.

Most of the time this happens when I need to display data that would take up two or three times as much of the width as my layout will allow.

The solution to this problem is quite simple: Use templated columns and Literal controls.

Continue reading “GridViews – Multiple Rows Per Record”

Unsafe Mode in C#

tp_vol4_006 One of the “advantages” of using CSharp instead of VB.NET is that if programmers want to, they have the option of bypassing the memory management of .NET and working with memory directly.  This is called “unsafe” mode.

While I will show you how to use this keyword, I have to tell you up front that I’ve been using CSharp since Beta 2 of .NET 1.0 and I’ve NEVER needed to switch into unsafe mode to do any of the work that I’ve done.

I’ve even written code that bridged down to some unmanaged C++ code and still have not needed to use unsafe mode.

Continue reading “Unsafe Mode in C#”