Showing posts with label email. Show all posts
Showing posts with label email. Show all posts

Sunday, March 11, 2012

bidirectional snapshot replication?

I currently have a list of users in a SQL 2005 database. Users are
authenticated based on their email address, and each user has a number
of areas they do and don't have access to. A website is used to add
users to the database, or to add area permissions for an exisiting
user.
I would like to set up a number of replicated servers around the world.
At least one would have very high latency and very low bandwidth to it.
All Sites are connected by VPN.
My question is: Is there a way to do bidirectional replication between
all of the servers? All servers would ideally be both publishers and
subscribers.. If so, which type of replication would you use? I was
thinking snapshot replication twice a day, but that may not make
sense..
Thanks in advance..
Have a look at peer-to-peer transactional replication - this sounds like
what you require.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Sunday, February 19, 2012

Best way to send email from a C# stored procedure?

I thought I could just copy over some asp.net code like:

System.Web.Mail.MailMessage mailMessage =new System.Web.Mail.MailMessage();

But VS2005 doesn't seem to want me touching System.Web.Mail.

Any ideas?

Thanks,

Allen

OK, I figured out that I need to useSystem.Net.Mail, but here is the next problem- when I create an instance of the SmtpClient object like this:

SmtpClient

client =newSmtpClient("localhost",25);I get this exception:
System.Security.SecurityException: Requestfor the permissionof type'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.System.Security.SecurityException: at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) at System.Security.CodeAccessPermission.Demand() at System.Net.Mail.SmtpClient.Initialize() at System.Net.Mail.SmtpClient..ctor(String host, Int32 port)
|||

has anyone managed to solve this one?

am getting the same error...

|||

I was able to get around that error (and a few others) by doing the following:

ALTER DATABASE [PUBS]SET TRUSTWORTHYONGOALTER ASSEMBLY [TaskScheduler]WITH PERMISSION_SET = UNSAFE

I hope this helps.

-Allen Cryer

|||

I was able to get around that error (and a few others) by doing the following:

ALTER DATABASE [PUBS]SET TRUSTWORTHYONGOALTER ASSEMBLY [TaskScheduler]WITH PERMISSION_SET = UNSAFE

I hope this helps.

-Allen Cryer

|||mate,you're a champ.I've looked for the last 24 hours all over.Thank you very much. Works like a charm now.