Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting ASP.Net to .Net 4.0 throws MSDTC error

Status
Not open for further replies.

mellomel70

Programmer
Nov 2, 2010
10
US
Hi - I've just converted an ASP.Net 2.0 solution to 4.0. In general, it seems to work fine, but there's one point in the code that consistently throws an error on 2 Windows 7 machines, one 32-bit, one 64-bit. The same code works fine on a Windows 2003 machine in the 2.0 framework. Note that both versions are being run through Visual Studio, the 2.0 version in VS2005, the 4.0 version in VS2010. I also get the same error message if I publish the 4.0 version to a Windows 7 machine and run it from IIS or in the browser (IE9). The code that breaks is as follows:

string strSelect = "SELECT * FROM Tasks WHERE UserID = " + UserID + " AND ClsdDate IS NULL AND Task LIKE 'Employee Move - " + RequestItemName + "%'";

SqlConnection dsConn = new SqlConnection(ConfigurationManager.AppSettings["DSN_TRACKIT"].ToString());

SqlDataAdapter dsDataAdapter = new SqlDataAdapter(strSelect, dsConn);

SqlCommandBuilder dsCommandBuilder = new SqlCommandBuilder(dsDataAdapter);

dsDataAdapter.UpdateCommand = dsCommandBuilder.GetUpdateCommand();

dsDataAdapter.Fill(dsTrackit,"MoveTasks");



The error message is:



Network access for Distributed Transaction Manager (MSDTC) has been disabled.
Please enable DTC for network access in the security configuration for MSDTC
using the Component Services Administrative tool



Note that the code does not involve a transaction, or more than one SQL Server and my DBA swears that DTC is enabled on ALL SQL Servers involved in this solution.



So what's going on here? I've googled the error message, but I've seen nothing that could explain this. I don't know if this is a Windows 7 issue or a .Net 4.0 issue.



Thanks!
 
start the MSDTC service on the webserver.

Jason Meckley
Senior Programmer

faq855-7190
faq732-7259
My Blog
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top