Friday, March 17, 2006

Windows Forms Development

After spending alot of time with ASP.NET, I was suprised to find how different Windows forms 2.0 is from the 2.0 version of ASP.NET. Take the ObjectDataSource control as an example.

I start by creating a class library containing a typed dataset containing a single simple SQLServer table. When I build it, and reference this in a new ASP.NET project, I can use the ObjectDataSource to find the right object, link to my DataSet1, and using the TableAdapter source displayed, select the getData() function. When I display default.aspx, the table data displays as expected.

Now for a Windows form. The ObjectDataSource control shows up as before, and I have both a DataTableBindingSource and a TableAdapterSource as candidates. The latter is useless, setting "ClearBeforeFill as a column name. The DataTableBindingSource sets up the correct columns, but when I display there is no data. Strange.

No comments: