OleDb + DataReader

<%@ Page language="C#" %><script language="C#" runat="server"> private void Page_Load(object sender, System.EventArgs e) {   System.Data.OleDb.OleDbConnection _conn =     new System.Data.OleDb.OleDbConnection();   _conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +     "DataSource=D:\\WebRoot\\data\\data.mdb";   System.Data.OleDb.OleDbCommand _cmd = _conn.CreateCommand();   _cmd.CommandType = System.Data.CommandType.Text;   _cmd.CommandText = "SELECT Name FROM Users WHERE ID=1";   _conn.Open();   System.Data.OleDb.OleDbDataReader _reader = cmd.ExecuteReader();   if(_reader.Read())   {     this.TextBox1.Text = _reader.GetString(0);   }   _reader.Close();   _conn.Close();}</script><html><body><form ID="Form" runat="server"> <asp:TextBox id="TextBox1" runat="server"></asp:TextBox></form></body></html>

Automatic globalization of the Label control

The PreRender event of the Label control allows to attach a method that can translate the value of the Text property. Connected with a resource or a database and used in a custom base class for Page or in a server control it's very easy to localize a website. override protected void OnInit(EventArgs e){  ctrl.PreRender += new System.EventHandler(Translator.TranslateLabel);  ...