OleDb + DataSet

<%@ 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;" +
     "Data Source=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";
    System.Data.OleDb.OleDbDataAdapter _adapter =
     new System.Data.OleDb.OleDbDataAdapter();
    _adapter.SelectCommand = _cmd;
    System.Data.DataSet _dataset = new System.Data.DataSet();
    _adapter.Fill(dataset, "UserTable");
      this.TextBox1.Text =
<form ID="Form" runat="server">
 <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

Comments (1) -

  • Eye opening Article! At last somebody who really knows what
    they are talking about and can additionally produce
    exellent material for us the readers. Certainly looking forward to your next posting.

Add comment