Dave Burke : Freelance .NET Web Developer specializing in Online Communities

ADO.NET 2.0 Bits

I've done very little graphic data configuration and drag-n-drop stuff in VS2003, but I'm getting a hang of it in VS2005 and Winforms.  I just mentioned I am primarily using Custom DataSets in a Smart Client data model.  One thing I failed to mention is the improvements in ADO.NET 2.0 in working with DataSets.  Here's a quick XML schema of a custom DataSet (one of several views), with the ability to model and define relationships, constraints, keys, and so on.  Very sweet.  Below the screenshot is a quick code excerpt on populating a dataset consisting of two tables in ADO.NET 2.0.  Not a lot of code is required to get the job done!




public MyDataSet GetMyDataSet()
{
MyDataSet myDataSet = new MyDataSet();

MyDataSetTableAdapters.daProjects daprojects = new MyDataSetTableAdapters.daProjects();
daprojects.Fill(myDataSet.dtProjects, "20");  // "20" is a parameter to a Stored Procedure

MyDataSetTableAdapters.daUsers dausers = new MyDataSetTableAdapters.daUsers();
dausers.Fill(myDataSet.dtUsers);

return myDataSet;
}

Comments (0) | Post RSS RSS comment feed

Posted on 6/15/2005 1:20:00 PM by Dave Burke
Categories: .NET
Tags:

Related posts


Powered by BlogEngine.NET 2.0.0.36
Theme by Dave Burke