TransactionScope link to remote server has firewall problem

G

Guest

When I use TransactionScope to access a remote SQL server from my Windows/XP
computer, I got error message "The transaction has already been implicitly or
explicitly committed or aborted".
But if I turn off the firewall on my Windows/XP computer, this code runs
without any problems.

Does anybody know how to set the firewall to allow TransactionScope to work?

Here is the simple code I am using:

using (TransactionScope ts = new TransactionScope())
{
SqlConnection conn = new SqlConnection(@"integrated
security=SSPI;data source=WSDEV\GODS;initial catalog=MOSES");
conn.Open(); //here I get the problem
ts.Complete();
}
 
S

Sahil Malik [MVP C#]

Are you using SQL Server? If so, open port 1433 - or simply create an
application based rule to open the necessary ports.
 
G

Guest

I am using SQL server. Then I opened port 1433 on my Windows/XP client
computer. I still get that error message: "The transaction has already been
implicitly or explicitly committed or aborted".

If I disable my Windows/XP firewall, it works fine.

Are there other ways I can try?

Thanks a lot.
 
S

Sahil Malik [MVP C#]

Definitely your firewall is blocking the communication to your SQL Server.
Are you using named pipes or TCP/IP to connect to your SQL Server?

SM
 
G

Guest

I think I use TCP/IP to link to the SQL server because my local computer's
network setting is TCP/IP.

And I tried to open port 1433 for both TCP and UDP. And I still have the
same problem.

Any other things I can try?

Thanks a lot.
 
S

Sahil Malik [MVP C#]

Okay lets try and isolate the problem first ... try this.
Without using System.Transactions .. see if you can open a SqlConnection. If
you indeed can, then follow the instructions on this post here -
http://blogs.msdn.com/florinlazar/archive/2004/06/18/159127.aspx

If you can't open a SqlConnection AT ALL - Sys.Tx or not, then the issue is
in communicating with SQL Server, reply back and we'll look into fixing
that.

- Sahil Malik [MVP]
ADO.NET 2.0 book -
http://codebetter.com/blogs/sahil.malik/archive/2005/05/13/63199.aspx
__________________________________________________________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top