Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where's the code for Dataset ToolStrips?
Message
From
15/09/2007 23:29:42
 
 
To
15/09/2007 06:20:07
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01254524
Message ID:
01254572
Views:
14
Sorry, David ... this doesn't really answer your question at all, but I felt compelled to post. <g>

This is my pet peeve. What you're doing is putting your DataAccess into your UserInterface. This is not considered one of the "best practices" for application design. You really want to have a totally separate Data Access Layer. Read the info in the following article by Brian Noyes. He makes some good points, and also discusses some TableAdapter ideas (including some stuff that may help to answer your questions):

http://www.theserverside.net/tt/articles/showarticle.tss?id=DataSetDesigner

I haven't read the whole article, but what I've read is pretty good (although he misses the boat on what to return from a Web Service, IMHO ... but that's a whole 'nother discussion <g>).

Here's another article I found about n-tier and/or n-layer applications. This article deals with a Web application, but the basics apply to a Windows application as well.

http://www.aspnetpro.com/NewsletterArticle/2007/02/asp200702dw_l/asp200702dw_l.asp

I also wanted to rant against TableAdapters ... I just don't like them, but I thought I should back up my opinion with a few articles and blogs:

http://adoguy.com/2006/06/08/TableAdapters_-_A_Critique.aspx
http://objectsharp.com/cs/blogs/bruce/archive/2007/06/05/connection-strings-and-tableadapters-revisited.aspx

There's more rants against TableAdapter out there. And probably just as many that *like* TableAdapters. But I was getting tired of all this Googling. <g>

~~Bonnie





>When one drags a column from a datasource onto a form, VB.NET kindly creates a ToolStrip at the top of the form with useful controls like Next, Previous, Add, Delete and Save. However, it only writes the code for Save to the form, e.g.
>
>
>Private Sub TableNameBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TableNameBindingNavigatorSaveItem.Click
>
>       Me.Validate()
>       Me.TableNameBindingSource.EndEdit()
>       Me.TableNameTableAdapter.Update(Me.DataSetName.TableName)
>
>End Sub
>
>
>I needed to write code to emulate the ToolStrip's behaviour when clicking on the Add symbol, and came up with:
>
>
>Dim DefaultDate1 As Date
>DefaultDate1 = Now
>Me.TableNameTableAdapter.Insert("", "", "", "", "", DefaultDate1, "", "")
>Me.TableNameBindingSource.AddNew()
>
>
>Is that correct? If not, how can I see the code used by each of the items in the ToolStrip container? I've tried the Edit Items option, but I couldn't find it there.
>
>Finally, does the Delete method of a table adapter really require ALL the columns as parameters?
>
>Thanks,
>David.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform