Last post Feb 05, 2006 10:24 PM by ScottGu
Jan 18, 2006 08:53 PM|gotech.voip|LINK
I have used VS.NET 2003 extensively and exploited all features like drag and drop functions for creating components, drag and drop data access components...For example VS.NET 2003 allows creating sqldataadapter for table mapping , stored proc parameters
We can drag pretty much any object on component designer....
Not it seems like all that gone...
VS.NET 2005, there is no way we can drag the typed dataset, sqldata adapter, sqlcommand on forms designer . There is no concept of component. There is no component designer any more....
Biggest flaw i found is sqldatasource and objectdatasrouce doesn't support transaction anymore...
there is no way to supply any current live db transaction to these objects...How can you imagine any app without transaction.
Please share ideas...
Jan 20, 2006 12:08 AM|ScottGu|LINK
I made a blog post about how to create Strongly Typed DataSets, TableAdapters and DataTables last week that you can read here:
http://weblogs.asp.net/scottgu/archive/2006/01/15/435498.aspx. I'd recommend checking it out to learn about new ways to build DAL components in VS 2005. I think you'll find this solution
actually much better than adding the SqlDataAdapters directly on your forms -- since you can re-use them across multiple pages.
Hope this helps,
Jan 30, 2006 03:01 PM|gotech.voip|LINK
Jan 30, 2006 06:44 PM|ScottGu|LINK
#1 If you drag the "DataTable" component from the toolbox on the DataSet designer, you can define the DataTables/DataSets independent of the database.
#2 You can use the TransactionScope feature in code to scope multiple updates/operations into a single atomic transaction. These can span multiple TableAdapters.
Feb 01, 2006 09:27 AM|gotech.voip|LINK
Feb 01, 2006 08:34 PM|ScottGu|LINK
There is no automatic way to drag/drop them onto the form designer. What you can do though is this:
1) Create a class with methods to return and update values into the dataset/table. This would replace the need for a TableAdapter.
2) Add an ObjectDataSource control to the page, and then pick the class you created in step #1 to get/update the data.
3) You can then databind controls on the page to the objectdatasource.
Feb 02, 2006 08:22 AM|gotech.voip|LINK
Feb 03, 2006 03:37 AM|ScottGu|LINK
If you only want to cause the GridView to bind when a ceretain event happens, you can just right code like this:
GridView1.DataSource = MethodToGetYourDataTable()
Feb 03, 2006 08:59 AM|gotech.voip|LINK
I know that part...my question is ...how to stop xxxDatasource loading data by itself- i don't want data load event to trigger unlesss i want it....
This seems to default behaviour - it alwasy laods data on page load....
Feb 05, 2006 10:24 PM|ScottGu|LINK
By default it will databind when it needs data (which is why it is firing on the initial page_load). If you want more control you can do one of two things:
1) explictly databind it like I showed above
2) you can handle the "selecting" event on the Objectdatasource and optionally change the eventargs value to e.Cancel = true if you want to prevent a databind action from occuring. That way you can selectively cancel a databind depending on the circumstances
of how it fires.