Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Friday, March 9, 2012

Managing subscribers from remote machine?

It looks like I can manage mostly everything within NS schema remotely, except subscribers and subscriptions.

The SubscriberEnumeration class wants an NSInstance reference, which only works running on local SQL server. As it reads and writes directly to the registry.

Is there something that I’m over looking to be able to enumerate the subscribers for an instance from a remote machine?

John

Install the client tools and then register the SSNS instance on the remote machine. That'll give you the API and registry entries you'll need.

HTH...

Joe|||

I have looked through the enumeration class. It only works on the local SQL server; I cannot use the class on my client machine and manage the subscriptions remotely with it. I have although, found that for every Instance's database, there are stored procedures that i can call to get a list of subscribers and devices and so fourth.

John

|||The SSNS API can be used from a remote machine. In fact, this is the most common deployment scenario - SSNS running on one server, the backend database running on a separate server, and the Subscription Management Application running on a web server.

To gain access to the remote instance of SSNS you'll need to install the client components and register the instance (pointing it to the remote server that hosts the instance, this will create the necessary registry entries, performance counters for you).

Here are a few links that may help.

http://msdn2.microsoft.com/en-us/library/ms171319.aspx
http://msdn2.microsoft.com/en-us/library/ms171263.aspx
http://msdn2.microsoft.com/en-us/library/ms143466.aspx
http://msdn2.microsoft.com/en-us/library/ms172627.aspx

HTH...

Joe

Wednesday, March 7, 2012

Managing Distributed Transactions with ADO.NET 2.0 using TransactionScope gives error mess

Hi,

I am working on vs2005 with sql server 2000. I have used TransactionScope class.

Example Reference:

http://www.c-sharpcorner.com/UploadFile/mosessaur/TransactionScope04142006103850AM/TransactionScope.aspx

The code is given below.

using System.Transactions;

protected void Page_Load(object sender, EventArgs e)
{

System.Transactions.TransactionOptions transOption = new System.Transactions.TransactionOptions();
transOption.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted;
transOption.Timeout = new TimeSpan(0, 2, 0);

using (System.Transactions.TransactionScope tranScope = new System.Transactions.TransactionScope(TransactionScopeOption.Required,transOption))
{
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["nwConnString"].ConnectionString))
{
int i;
con.Open();
SqlCommand cmd = new SqlCommand("update products set unitsinstock=100 where productid=1", con);
i = cmd.ExecuteNonQuery();
if (i > 0)
{
using (SqlConnection conInner = new SqlConnection(ConfigurationManager.ConnectionStrings["pubsConnString"].ConnectionString))
{
conInner.Open();
SqlCommand cmdInner = new SqlCommand("update Salary set sal=5000 where eno=1", conInner);
i = cmdInner.ExecuteNonQuery();
if (i > 0)
{
tranScope.Complete(); // this statement commits the executed query.
}
}
}
}
// Dispose TransactionScope object, to commit or rollback transaction.
}

}

It gives error like

"The partner transaction manager has disabled its support for remote/network transactions. (Exception from HRESULT: 0x8004D025)"

The database I have used is northwind database and pubs database which is by default in sql server 2000.

So, Kindly let me know how to proceed further.

Thanks in advance,

Arun.

Hi,

From your description, it seems that you met the "The partner transaction manager has disabled" error when you want to run the distributed transaction in your project, right?

Generally, the cause of the issue is that you didn't set the transaction service properly. You may following the steps below:

First verify the "Distribute Transaction Coordinator" Service is
running on both database server computer and client computers
1. Go to "Administrative Tools > Services"
2. Turn on the "Distribute Transaction Coordinator" Service if it is not running

If it is running and client application is not on the same computer as
the database server, on the computer running database server
1. Go to "Administrative Tools > Component Services"
2. On the left navigation tree, go to "Component Services > Computers
> My Computer" (you may need to double click and wait as some nodes
need time to expand)
3. Right click on "My Computer", select "Properties"
4. Select "MSDTC" tab
5. Click "Security Configuration"
6. Make sure you check "Network DTC Access", "Allow Remote Client",
"Allow Inbound/Outbound", "Enable TIP" (Some option may not be
necessary, have a try to get your configuration)
7. The service will restart
8. BUT YOU MAY NEED TO REBOOT YOUR SERVER IF IT STILL DOESN'T WORK
(This is the thing drove me crazy before)

On your client computer use the same above procedure to open the
"Security Configuration" setting, make sure you check "Network DTC
Access", "Allow Inbound/Outbound" option, restart service and computer
if necessary.

On you SQL server service manager, click "Service" dropdown, select
"Distribute Transaction Coordinator", it should be also running on
your server computer.

Quoted from community members of MSDN:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=230390&SiteID=1

Thanks.