Home All Groups Group Topic Archive Search About

Using Typed Dataset with Winform vs ASP.NET

Author
18 Feb 2006 11:09 PM
David R
Something doesn't make sense here.

I create 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.  As ObjectDataSource candidates, I have both a
DataTableBindingSource and a TableAdapterSource.  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.

Why is the Windows form so different, and is it possible to use typed data
sets from a different project on Windows forms?

Thanks,
--
David R

Author
18 Feb 2006 11:26 PM
Otis Mukinfus
On Sat, 18 Feb 2006 15:09:27 -0800, "David R"
<Dav***@discussions.microsoft.com> wrote:

Show quote
>Something doesn't make sense here.
>
>I create 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.  As ObjectDataSource candidates, I have both a
>DataTableBindingSource and a TableAdapterSource.  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.
>
>Why is the Windows form so different, and is it possible to use typed data
>sets from a different project on Windows forms?
>
>Thanks,
Sad they gave that functionality to the ASP.NET guys but not the Win
Forms guys.

I have been able to make objects work as a DataSource in Win apps, but
was not able to use anything generated by the ObjectdataSource of
ASP.NET.  The two don't work the same, unfortunately.

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
Author
19 Feb 2006 7:38 AM
Cor Ligthert [MVP]
> Why is the Windows form so different, and is it possible to use typed data
> sets from a different project on Windows forms?
>
You are not the only one who asks this, AFAIK are there actions busy to
bring back some old Net 1.x ways back to ASPNET 2.0. However I nowhere have
read what. It is just starting as I understood.

In fact is the windowforms way not different. The way ASPNET uses in 2.0 is
completely different from NET 1.x. Windowsforms is much more (not complete)
consistent. (The ASPNET 2.0 method seems for me completely build around the
designer).

Just what I think I know at the moment.

Cor
Author
19 Feb 2006 3:27 PM
Otis Mukinfus
On Sun, 19 Feb 2006 08:38:21 +0100, "Cor Ligthert [MVP]"
<notmyfirstn***@planet.nl> wrote:

Show quote
>
>> Why is the Windows form so different, and is it possible to use typed data
>> sets from a different project on Windows forms?
>>
>You are not the only one who asks this, AFAIK are there actions busy to
>bring back some old Net 1.x ways back to ASPNET 2.0. However I nowhere have
>read what. It is just starting as I understood.
>
>In fact is the windowforms way not different. The way ASPNET uses in 2.0 is
>completely different from NET 1.x. Windowsforms is much more (not complete)
>consistent. (The ASPNET 2.0 method seems for me completely build around the
>designer).
>
>Just what I think I know at the moment.
>
>Cor
>
Cor,

I have done some experimenting with the ASP.NET ObjectDataSource
control and it works fairly well. 

The only book I have seen that really describes how to use it is
"Murach's ASP.NET 2.0 Upgrader's Guide":
http://www.murach.com/books/ugcs/index.htm

In his book he goes into the 'dirty details' of how to use it.

Otis Mukinfus
http://www.otismukinfus.com
http://www.tomchilders.com
Author
20 Feb 2006 7:23 AM
Cor Ligthert [MVP]
Otis,

>>
>>In fact is the windowforms way not different. The way ASPNET uses in 2.0
>>is
>>completely different from NET 1.x. Windowsforms is much more (not
>>complete)
>>consistent. (The ASPNET 2.0 method seems for me completely build around
>>the
>>designer).
>>
>
> I have done some experimenting with the ASP.NET ObjectDataSource
> control and it works fairly well.
>
I did that as well, it works very nice (as soon as you know that the "build"
has some extra meanings). I tried the datatableadapter with webpage,
webservice and with windowsform client connected to a webservice and than of
course the ObjectDataSource.

What I try to tell is that it is different from directly using a windowforms
application. This 2.0 ASPNET methode is very different from 1.x and
windowforms, and that I do not find fine to create good maintainable
programs.

Cor
Author
20 Feb 2006 11:36 PM
David R
Thanks for the information. 

Is there a way of using a typed dataset created in a class library, in a
WinForm project? 

I could do this without a problem with ASP.NET, but not with WinForm.   With
the latter,  I cannot find a way of returning a typed dataset from a class
library.  I can build a untyped dataset, but not the typed. 
--
David R


Show quote
"Cor Ligthert [MVP]" wrote:

> Otis,
>
> >>
> >>In fact is the windowforms way not different. The way ASPNET uses in 2.0
> >>is
> >>completely different from NET 1.x. Windowsforms is much more (not
> >>complete)
> >>consistent. (The ASPNET 2.0 method seems for me completely build around
> >>the
> >>designer).
> >>
> >
> > I have done some experimenting with the ASP.NET ObjectDataSource
> > control and it works fairly well.
> >
> I did that as well, it works very nice (as soon as you know that the "build"
> has some extra meanings). I tried the datatableadapter with webpage,
> webservice and with windowsform client connected to a webservice and than of
> course the ObjectDataSource.
>
> What I try to tell is that it is different from directly using a windowforms
> application. This 2.0 ASPNET methode is very different from 1.x and
> windowforms, and that I do not find fine to create good maintainable
> programs.
>
> Cor
>
>
>
Author
21 Feb 2006 11:49 AM
Otis Mukinfus
On Mon, 20 Feb 2006 15:36:26 -0800, "David R" <Dav***@discussions.microsoft.com>
wrote:

>Thanks for the information. 
>
>Is there a way of using a typed dataset created in a class library, in a
>WinForm project? 
>
>I could do this without a problem with ASP.NET, but not with WinForm.   With
>the latter,  I cannot find a way of returning a typed dataset from a class
>library.  I can build a untyped dataset, but not the typed. 
David,

I haven't tried it with .NET 2.0, but in .NET 1.1 you can create Typed DataSets
on a component and use the component as the DAL.  When adding a new object to
the project choose component instead of class.

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Author
21 Feb 2006 6:11 PM
David R
Thanks.  You can create a ComponentClass as a new item in a project.  I tried
this out, and it is an option.

Did have one problem.  I just happened to have a class named component.cs in
the namespace that I was trying to create the component class, which
generated an error in the designer.  Renaming my class fixed the problem.

--
David R


Show quote
"Otis Mukinfus" wrote:

> On Mon, 20 Feb 2006 15:36:26 -0800, "David R" <Dav***@discussions.microsoft.com>
> wrote:
>
> >Thanks for the information. 
> >
> >Is there a way of using a typed dataset created in a class library, in a
> >WinForm project? 
> >
> >I could do this without a problem with ASP.NET, but not with WinForm.   With
> >the latter,  I cannot find a way of returning a typed dataset from a class
> >library.  I can build a untyped dataset, but not the typed. 
> David,
>
> I haven't tried it with .NET 2.0, but in .NET 1.1 you can create Typed DataSets
> on a component and use the component as the DAL.  When adding a new object to
> the project choose component instead of class.
>
> Otis Mukinfus
> http://www.arltex.com
> http://www.tomchilders.com
>
Author
21 Feb 2006 2:35 AM
David R
Solved the problem, by returning the typed dataset as a data transfer object.
I can then use the same solution for both the ASP.NET and WinForm projects.

Thanks!


--
David R


Show quote
"David R" wrote:

> Something doesn't make sense here.
>
> I create 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.  As ObjectDataSource candidates, I have both a
> DataTableBindingSource and a TableAdapterSource.  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.
>
> Why is the Windows form so different, and is it possible to use typed data
> sets from a different project on Windows forms?
>
> Thanks,
> --
> David R

AddThis Social Bookmark Button