Game Development Reference
In-Depth Information
using System;
using System.Data;
using System.Data.OleDb;
using System.Data.Common;
using System.Windows.Forms;
string connectionString
= @”Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\YourDB.mdb”;
OleDbConnection connection = new OleDbConnection(connectionString);
OleDbDataAdapter adapter = new OleDbDataAdapter(“SELECT * FROM YourTable”,
DataSet dataSet = new DataSet();
adapter.Fill(dataSet, “YourTable”);
This example only shows the select, but after any sort of editing, you can call the
following method to persist your changes back to the database.
Working with XML
Before showing how to load an XML document, we should first define a simple
XML document that we can load (Books.xml).
<?xml version='1.0'?>
<!— This file represents a fragment of a book store inventory database —>
<book genre=”autobiography” publicationdate=”1981” ISBN=”1-861003-11-0”>
<title>The Autobiography of Benjamin Franklin</title>
<book genre=”novel” publicationdate=”1967” ISBN=”0-201-63361-2”>
<title>The Confidence Man</title>
Search Nedrilad ::

Custom Search