|
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DataDigest.Datas.Helper;
namespace DatasetAdaptorSample
{
/// <summary>
///
/// </summary>
/// <remarks>
/// - think about incrementseed set to 1 in datatables when you work with datasets on datagridview...
/// - when using an attached mdb, specify in its "Copy to Output Directory" property to "copy if newer"
/// in order to keep the last version of the db (mainly when debugging)
/// </remarks>
public partial class SampleDataSetAdaptor : Form
{
DataSetAdaptor<sampleDBDataSet> dtsAdaptor = null;
public SampleDataSetAdaptor()
{
InitializeComponent();
// initialize the adaptor
dtsAdaptor = new DataSetAdaptor<sampleDBDataSet>(dataSet);
}
private void SampleDataSetAdaptor_Load(object sender, EventArgs e)
{
// download datas from db
dtsAdaptor.Fill();
}
private void buttonUndo_Click(object sender, EventArgs e)
{
// reload datas from db
dtsAdaptor.Fill();
}
private void buttonSave_Click(object sender, EventArgs e)
{
// update db with updates made on the dataset
// warning, it doesn't update the content dataset with modification done in db...
dtsAdaptor.SaveChanges();
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
* Bachelor of Information Management at ISAT Charleroi in Belgium.
* Master II of Information science at UMH Mons.
I spend my time in small projects which can help me or small enterprises and
I am very interested in designing projects
with specifications of UML or in applying usual design patterns.