Using Typed Dataset with Winform vs ASP.NET

G

Guest

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,
 
O

Otis Mukinfus

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
 
C

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
 
O

Otis Mukinfus

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
 
C

Cor Ligthert [MVP]

Otis,
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
 
G

Guest

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.
 
G

Guest

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!
 
O

Otis Mukinfus

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top