ObjectDataSources Don't Work with Typed DataSets


Url: http://msdn.microsoft.com/newsgroups/default.as...

According to this post (this highlights my belief that MS is discouraging DataSets enough though they are using them everywhere (e.g. inside DataSources)).  SInce Typed DataSets don't work out of the box with ObjectDataSources, we are left with three uncomfortable solutions:

  • Ditch them and write Business Objects even in small apps
  • Use SqlDataSources and don't allow NULL's in any of our columns (see my previous rant).
  • Write a wrapper class around every DataTable (or perhaps in the partial class) to allow the Object DataSource to work with it. 

The Partial Class solution may be easiest, but it is still some magical mix of parameters that will make it appear in the ObjectDataSource configuration dialog.  I hope to have a better solution soon for this, but don't count on it.



Shawn
Shawn Wildermuth
Author, Teacher, and Coach




My Courses

Wilder Minds Training
Vue.js by Example (New Lower Price)
Bootstrap 4 by Example (New Lower Price)
Intro to Font Awesome 5 (Free Course)
Pluralsight
Building an API with ASP.NET Core (New Course)
Building a Web App with ASP.NET Core, MVC6, EF Core, Bootstrap and Angular (updated for 2.2)
Less: Getting Started (New)
Using Visual Studio Code for ASP.NET Core Projects
Implementing ASP.NET Web API

Application Name WilderBlog Environment Name Production
Application Ver v4.0.30319 Runtime Framework x86
App Path D:\home\site\wwwroot\ Runtime Version .NET Core 4.6.27817.01
Operating System Microsoft Windows 10.0.14393 Runtime Arch X86