Multitier application and Datagrid

1 view
Skip to first unread message

André Wagner

unread,
May 8, 2008, 9:09:38 AM5/8/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Hello,

I'm trying to understand how can I write a application in three layers
and use a datagrid on a object.

For example, let's say I have a table on my database (COUNTRIES) with
the fields ID and DESCRIPTION. And I have a class Country that would
connect to this table:

class Country
{
public int ID { get; set; }
public string Description { get; set; }
}

Now, I know I can create a data source out of this object and connect
it to a datagrid. But how then can I handle things updates, inserts
and deletions in the datagrid?

Thank you in advance,

André

Cerebrus

unread,
May 8, 2008, 2:04:42 PM5/8/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
One word - "ObjectDataSource".

André Wagner

unread,
May 8, 2008, 2:11:04 PM5/8/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
But: I'm not using ASP. Can I use ObjectDataSource with just C#?

Regards,

André

Rohit

unread,
May 8, 2008, 4:15:07 PM5/8/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting

Hi,

Well, I don't have an exact answer for your problem but I know a
link which can help you.

http://www.asp.net/learn/data-access/

Its a pretty long tutorial and would require your patience. It will
show you step by step way to accomplish your goal.
You will learn many more things too :)

Rohit Jaiswal

Crisatunity (blog.crisatunity.com)

unread,
May 11, 2008, 12:51:37 AM5/11/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Yes.

André Wagner

unread,
May 12, 2008, 9:26:59 AM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Can you give me a example of it?

On May 11, 1:51 am, "Crisatunity (blog.crisatunity.com)"

Andrew Badera

unread,
May 12, 2008, 2:24:20 PM5/12/08
to DotNetDe...@googlegroups.com

Crisatunity (blog.crisatunity.com)

unread,
May 12, 2008, 3:37:50 PM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
You're kidding, right?

André Wagner

unread,
May 12, 2008, 3:36:31 PM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Ok.

I mean: an example not in ASP. Check the Google results, you'll see
that all pages return examples in ASP. What I'm looking for is an
example in a desktop application.

André

On May 12, 3:24 pm, "Andrew Badera" <and...@badera.us> wrote:
> http://www.google.com/search?q=c%23+objectdatasource
>
> On Mon, May 12, 2008 at 9:26 AM, André Wagner <andre....@gmail.com> wrote:
>
> > Can you give me a example of it?
>
> > On May 11, 1:51 am, "Crisatunity (blog.crisatunity.com)"
> > <cleveridea....@gmail.com> wrote:
> > > Yes.
>
> > > On May 8, 1:11 pm, André Wagner <andre....@gmail.com> wrote:
>
> > > > But: I'm not using ASP. Can I use ObjectDataSource with just C#?
>
> --
> --
> --Andy Baderahttp://higherefficiency.nethttp://flipbitsnotburgers.blogspot.com/http://andrew.badera.us/http://changeroundup.com/

André Wagner

unread,
May 12, 2008, 3:42:08 PM5/12/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
> > Can you give me a example of it?
>
> You're kidding, right?

No, I'm not. I searched all examples in MSDN, and looked for it
everywhere in Google and couldn't find one example of ObjectDataSource
that's used in a desktop application and not ASP.

André

Cerebrus

unread,
May 13, 2008, 1:25:37 PM5/13/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
At last you've used the word "desktop application". All along you've
been saying "ObjectDatasource with C#", which tells us nothing.

No, I don't think you can use ObjectDataSource (the control) with
windows forms, and then you would never need to, because windows forms
has different ways of Databinding.

1. Google "BindingSource", "BindingNavigator", "TableAdapter".

2. Open the Datasources window and click "Add new Datasource" and
provide the path to your Data access layer. Of course, your datalayer
will need to confirm to certain standards. Read up some docs or how-
to's.


On May 13, 12:36 am, André Wagner <andre....@gmail.com> wrote:
> Ok.
>
> I mean: an example not in ASP. Check the Google results, you'll see
> that all pages return examples in ASP. What I'm looking for is an
> example in a desktop application.
>
> André
>
> On May 12, 3:24 pm, "Andrew Badera" <and...@badera.us> wrote:
>
>
>
> >http://www.google.com/search?q=c%23+objectdatasource
>
> > On Mon, May 12, 2008 at 9:26 AM, André Wagner <andre....@gmail.com> wrote:
>
> > > Can you give me a example of it?
>
> > > On May 11, 1:51 am, "Crisatunity (blog.crisatunity.com)"
> > > <cleveridea....@gmail.com> wrote:
> > > > Yes.
>
> > > > On May 8, 1:11 pm, André Wagner <andre....@gmail.com> wrote:
>
> > > > > But: I'm not using ASP. Can I use ObjectDataSource with just C#?
>
> > --
> > --
> > --Andy Baderahttp://higherefficiency.nethttp://flipbitsnotburgers.blogspot.com/htt...
> > and...@badera.us
> > (518) 641-1280
> > Google me:http://www.google.com/search?q=andrew+badera- Hide quoted text -
>
> - Show quoted text -

caloggins

unread,
May 14, 2008, 6:26:42 PM5/14/08
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Although a bit dated, this is a good book to start with (Chapter 9 has
what you want):

Data Binding with Windows Forms 2.0: Programming Smart Client Data
Applications with .NET
By Brian Noyes
...............................................
Publisher: Addison Wesley Professional
Pub Date: January 12, 2006
Print ISBN-10: 0-321-26892-X
Print ISBN-13: 978-0-321-26892-1
Pages: 736
Reply all
Reply to author
Forward
0 new messages