Typed Dataset with Enterprise Library

Is there a way to populate a typed dataset with the Enterprise library? I am getting a "System.InvalidCastException" exception.


TypedDS dsRuns =new TypedDS();

Database dbMMS = DatabaseFactory.CreateDatabase("TestInstance");
string cmd = "SELECT* FROM blah";
DBCommandWrapper cmd = dbMMS.GetSqlStringCommandWrapper(cmd);
cmd.AddInParameter(":SDATE", DbType.String, datetimepickerDate.Text);

dsRuns = (TypedDS)dbMMS.ExecuteDataSet(cmd);


Also, is there a way to cast a value dynamically while it's being populated into a dataset? I have a database time field that is in seconds after midnight. I want to convert this field into the timespan type. Thanks.

[963 byte] By [JPark] at [2007-12-16]
# 1

I found a solution!
http://weblogs.asp.net/josh.robinson/archive/2005/03/30/396311.aspx



myDB.LoadDataSet(myCommandWrapper, (DataSet)myTypedDS, DataTableName");

JPark at 2007-9-9 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified