.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Wrapping Multiple TableAdapters inside Transactions

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :ASP.Net

Problem :

In my project's earlier version I used Stored Procedures (SPs) & directly used them inside presentation layer. SP contains multiple Insert & Update queries for multiple tables. 

Now I have decided to use a DAL(Typed DataSets & TableAdapters)

How can i use the same SPs with TableAdapters or If not possible how to wrap Multiple TableAdapters inside Transactions.

1 more thing in my earlier version i was using Transaction in SPs & Presentation Layer.

View Complete Post

More Related Resource Links

Toolbox: Easy File Backup, Exploring Files And Folders Inside Visual Studio, Multiple Monitor Softwa


If the responsibility for creating, managing, and executing routine backups is yours, these tools will make it easier. Also see how you can browse folders and files from inside Visual Studio.

Scott Mitchell

MSDN Magazine May 2009

Using Multiple Childview inside View

I want to create a view which will include 2 sections. In first section user selects values from dropdown and then click Search button, And want to display results in same View.Second section should comes after click event.  How should i implement this in MVC. Am filling dropdown using Viewdata so clicking on search button invoke action in controller. public actionresult search(){} /// in this action am loading all dropdowns with Viewdatapublic actionresult Searchresults( formcollection  post){  //search logicreturn view('search');}   problem am facing is when second action executes dropdowns starts looking for viewdata which is no more there. Can somebody help me

Select multiple checkboxes placed inside a combobox



I have just started working on WPF and I am fairly new to this technology. I need to add a excel filter like functionality for datagrid control. I have successfully added a combobox(with checkboxes inside) in the header of the datagrid. The datagrid needs to display "All" as first checkbox. If user checks this first checkbox all other checkboxes(inside same combo) need to be checked automatically. Following is my datatemplate for combo. I have placed in column header combo through codebehind.

<DataTemplate x:Key="comboTemplate">

   <ComboBox Name="cboTask" Loaded="cboTask_Loaded" Wid

Linq to SQL transactions with multiple deletes


I am trying to delete three related objects on one submit. Delete fails on one of the child objects, because of foreign key contraint with another table,  It deletes one (the parent) but not the two child objects. All in one SubmitChanges().

I even used the TransactionScope, still same thing. So here is the scenario:


I have an object called Page which has a collection of objects called Webinars.  There is another object Called Product which is one to one with Webinar.

Here is what I do:


What happens is, the webinar is gone, and tho other two stay in the database.

The reason it fails is because the Page record is refenced somewhere else. So what I want to know is why when one of them fails, the webinar still get deleted? Shouldn't it be all or none?


I also tried this:

 using (TransactionScope ts = new TransactionScope())



Strongy typed datasets, tableadapters and transactions


I'm using a stronly typed dataset built with the Visual Studio dataset designer for a .Net 2.0 application (cannot move above 2.0 unfortunatly)

On a simple level my database has two tables, Persons and Addresses. An Address record has a foriegn key to a Person from the Persons table.

When a new Person is created an Address is also inserted for the Person, I'd like this to be in a single transaction that can be committed or rolledback using the tableadapters.

This approach seems very close: http://www.codeproject.com/KB/dotnet/transactionta.aspx

This method is failing when the dataset is set to Refresh records on Insert/Update, but I need this Refresh to pull the ScopeIdentity and update the dataset so I know the new ID of a created record in Persons or Addresses.

Any ideas?

Need an MVC Guru !!! Best Practice to have multiple Strongly Type Models ...inside a single View ??


So far I've seen demos of MVC that have simple pages, one for login, one for register, one for listing a table ...

In order to understand better the transition for WebForms developers into MVC patterns, I would like to understand how can I put together multiple CONTROLS (like the one provided by the default MVC project that VS2010 creates for us ...and make it work.

OK so as an example, imagine we want to change the LogonUserControl.ascx to allow us to login (so to show UserName and Password textboxes and Logon button) from the Home Page.

1) We update the Control as follow:

2) We update the HomeController.cs file to handle the Logon Button Post event as follow:


We needed to move some code from AccountController to HomeController in order to get the control to work under the Index view. So ...with little luck it seems to work !!!

Now the problem happens when you navigate to the Register view, considering that now we are not any longer on the HomeController "domain" but we are under AccountController.

Register page shows perfectly and

Multiple Fileupload into the sharepoint document library using Fileupload control inside gridview



how to upload multiple files to the sahrepoint document library using fileupload control inside the gridview.?

this is my form design:


<asp:Gridview id="gridview" runat ="server" autogentatecolum="false">


<asp:TemplateField Headertext="3DFinal" runat="Server">


<asp:FileUpload id="Fileupload1" runat ="Server"/>



<asp:TemplateField Headertext="2DFinal" runat="Server">


<asp:FileUpload id="Fileupload2" runat ="Server"/>



<asp:TemplateField Headertext="2Conceptaul" runat="Server">


<asp:FileUpload id="Fileupload3" runat ="Server"/>







<asp:Button id="Save" runat="server" Text="Save" onClick="btsave-Click"/>



If i click the save button the files should go to the sharepoint document library?

i need to uplaod multiple files to the document libray using file upload inside the gridview..

any one know about this file

Multiple file upload to the sharepoint document library using file upload control inside the gridvie


how to upload multiple files to the sharepoint document library using fileupload control inside the gridview.

form design is

<asp:GridView id="gridview1" runat="server"  autogenteratecolumn="false">

<asp:TemplateField HeaderText="3DFinal">


<asp:FileUpload id ="Fileupload" runat="Server"/>



<asp:TemplateField HeaderText="2DFinal">


<asp:FileUpload id ="Fileupload2" runat="Server"/>



<asp:TemplateField HeaderText="Final">


<asp:FileUpload id ="Fileupload3" runat="Server"/>





<asp:Button Id="Buuton1" runat="server" text="Save"/>

if i click save button files should go to my sharepoint document library.

if any one know pls help me...




Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Here is the code for binding the multiple drop down boxes in GridView using JQuery in ASP.NET

Accessing the different controls inside a GridView control

how we can access a particular control which resides inside a GridView control. In this article I will show you how you can access different controls inside a GridView control. We will see how we can access a TextBox control, a DropDownList control and a ListBox control. If you are working with ASP.NET 1.X then you might want to check out my article Accessing Different Controls Inside a DataGrid.

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

How To Add calendar control inside a GridView

This article show hot to add calendar control inside a GridView with code in c#

Using ATLAS PopUp Control with Calendar inside the GridView Control

In this video tutorial Mohammad demonstrates how you can access the Calendar control which is displayed using the ATLAS PopUp control inside the GridView control.

RadioButton inside GridView, How to get it work as normal

Did you tried before to drag a RadioButton control inside a Gridivew templatefield, and then you attempt to select these RadioButtons , you will notice that the behavior of RadioButton control will be changed and it will work just like the behavior of checkbox control! the user will be able to select more than one radiobutton in the grid!

Maintain HTML Radio Button Selection Inside GridView After Postback

Long time ago I wrote an article about getting the value of the selected RadioButtons inside the GridView control. The code did not addresssed the postback issue which means that the selected radio button was cleared after the postback occurs.

Adding Multiple Columns and Rows in GridView without using a Database

This article describes on how to add multiple columns and rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in each TextBoxes on Button Click and retain the GridView data on post back.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend