Click here to Skip to main content
15,888,033 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Update: I have been working on this all night, and from what I have read, it seems that binding business layer to winforms is different than that of asp.net. I have tried to do it with no luck.

could someone sums up the basic steps to do: "Binding Business Objects to WinForms". I found many examples on the web that only binds a class that you define. What I need to know is how to bind a business logic that return a DataSet, or DataTable to winforms.

thanks.

older post is below:

--------------------------------
Hi there...

I created a 3 tier application, it contains:
1-DAL:data access layer
2-BL: business logic
3-VL: view layer

if VL is an ASP.NET project, then I can access the dataset successfully, and I can get the columns and the data. If I use WinForms instead, I can only see the name of the dataobject, and I can't see the columns nor the data. The code of DAL, and BL is not changed in both Projects.

I am guessing I am doing something wrong in the BL. Its code is as follows:

VB
Imports System.ComponentModel

<DataObject()> _
Public Class TDTableObject

    ' the adapter
    Private TDAdapter As DAL.TodoDataSetTableAdapters.TDTableAdapter = _
       New DAL.TodoDataSetTableAdapters.TDTableAdapter

    ' the function is used to get the data table
    <DataObjectMethod(DataObjectMethodType.Select, True)> _
    Public Function GetTDTable() As DAL.TodoDataSet.TDDataTable
        Return TDAdapter.GetData
    End Function

End Class


I am guessing I am doing something wrong when settings the attributes for the class of BL before using it in the windows forms project. Again this same code works perfectly fine in ASP.NET.

what am I missing?

thanks for any idea.
Posted
Updated 19-Apr-11 14:46pm
v3
Comments
Simon_Whale 19-Apr-11 17:23pm    
Is the Business Logic and Datalayer hoested on the website?
Member 7742860 19-Apr-11 17:27pm    
Yes they are. To be exact in ASP.NET when I set the binding to a dataobject, I can see the table, and its columns. If I get rid of the ASP.NET project and use a windows project instead, then if I perform binding, I can see the DataObject only, I can never see the columns.
[no name] 20-Apr-11 11:57am    
I'm probably missing something, but would the Fill method be a better choice than GetData?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900