Filling typed datasets using Data Access Application Block v.2.0

My blog has moved.
You can view this post at the following address:
http://www.osherove.com/blog/2003/7/28/filling-typed-datasets-using-data-access-application-block-v.html
Published Monday, July 28, 2003 2:40 PM by RoyOsherove
Filed under:

Comments

Monday, July 28, 2003 6:08 AM by Mark Brown

# re: Filling typed datasets using Data Access Application Block v.2.0

Roy, I found a bug in version 2 of the applicaion block. Check out http://www.dotnetjunkies.com/weblog/markbrown/posts/454.aspx for details. I notified MS but havn't checked to see if the change is in the latest bits.
Wednesday, July 30, 2003 1:52 PM by Dave Burke

# re: Filling typed datasets using Data Access Application Block v.2.0

Roy, I continue to appreciate you sharing your experience with the Data Access App Block and ADO.NET in general. I was ready to implement your 3-line Getdataset method approach, but you're right, Lior's one-pass approach is even better. Keep up the great work! btw, thanks for posting a separate blog entry on the bug Mark discovered. I wouldn't have found it otherwise.
Wednesday, July 30, 2003 4:30 PM by TrackBack

# Data Access Application Block, Part 2 (Halfa bug)

Wednesday, July 30, 2003 4:30 PM by Dave Burke

# re: Filling typed datasets using Data Access Application Block v.2.0

Roy,

The following post describes my experience with your Filldataset() advice focusing on the fix reported by Mark Brown, which to me didn't appear to be a fix at all. I'd be interested in any comments you might have (strictly optional, of course.) Thanks!

http://weblogs.asp.net/dburke/posts/21931.aspx
Thursday, October 09, 2003 1:15 AM by joeler

# re: Filling typed datasets using Data Access Application Block v.2.0

where in the world is the definition for "ApartmentDataset" ?
Saturday, October 11, 2003 8:09 PM by Roy Osherove

# re: Filling typed datasets using Data Access Application Block v.2.0

Joeler: ApartmentDataset is a typed dataset that inherits from DataSet. It's not defined anywhere. It's just an example of how I'd use such a technique with a typed dataset.
Monday, December 15, 2003 2:43 PM by Pranav Method

# re: Filling typed datasets using Data Access Application Block v.2.0

Another method of specifing Table Names, assuming the default name is already specified in the xsd.

ApartmentDataset ds = new ApartmentDataset();
string[] tableNames = new string[ds.Tables.Count];

for (int i = 0; i < ds.Tables.Count; i++)
tableNames[i] = ds.Tables[i].TableName;
Sunday, March 21, 2004 2:09 PM by Tom Mallard

# re: Filling typed datasets using Data Access Application Block v.2.0

FWIW, newbie reading "Filling typed datasets...", just had gotten this to work as a global method for pages to use in a querystring, same idea as your helper. I'm migrating a portal from classic asp to c#.net, original asp code was organized this way, makes mapping functions to c# way easier than I expected since most were methods.

using System;

namespace yourNamespace {
/// <summary>
///
/// </summary>
public class uurl {
public uurl() { }
public string main(){
return getUURL();
}
public string getUURL() {
Random oRandom = new Random();
double dblRandom = oRandom.NextDouble();
double invRandom = 1/(dblRandom + 3.9);
DateTime oDateTime = DateTime.Now;
string strDateTime = oDateTime.ToString();
bool bGetToss = Convert.ToBoolean(System.Web.HttpContext.Current.Application["getToss"]);
int ms = oDateTime.Millisecond;
int invMS = 1/ms;
string strUURL = System.Web.HttpUtility.UrlEncode(strDateTime + "|" + bGetToss.ToString() + "|" + invRandom.ToString() + "|" + dblRandom.ToString() + "|" + ms + 1/ms + "|");
if(strUURL != "" || strUURL != null){
return strUURL.ToString();
}else{
return "default.IeekIEosLMdmwPOkowqUIFDUIuds9938ck83736ckd";
}
}
}
}

Then on a page:

yourNamespace.uurl oUURL = new yourNamespace.uurl();
this.strUURL = oUURL.getUURL().ToString();

good stuff, yum, yum,

kutgw,

newbie tom
Thursday, June 24, 2004 7:14 AM by Rahul

# re: Filling typed datasets using Data Access Application Block v.2.0

How do u use the DAAB to execute an action query that updates a row in a master table (User) and multiple rows in child tables (Addresses) in one call.

I was looking at using SQL XML. Wanted to validate if thats a suggested paradigm.

Thanks
Rahul
Sunday, November 14, 2004 8:21 AM by TrackBack

# Filling typed datasets using Data Access Application Block v.2.0

The new Microsoft Data Access Application Block is out, and it contains some nice changes. One of the nicest (and simplest) is the ability to fill a dataset(that may or may not be strongly typed) using the SQLHelper class. Source...