views:

32

answers:

1

Hi,

I've been definitely told by my IT office that as my SQLServer database is in a shared SQL Server they can't run any executables via the server scheduling task service . The executable would query my database on a daily basis, update data in it and send an email. First, is this true? And secondly, do I have an alternative using .net timer classes, for example? I would appreciate your advice. Many thanks.

UPDATE: This is the code I use to send emails. If I have it in a page of my site, it works. If I run it in a executable I get an error "Failure sending email" which I assume is because they don't let me?

Dim message As MailMessage = New MailMessage()
    message.From = New MailAddress("[email protected]")
    message.To.Add(New MailAddress("[email protected]"))
    message.Subject = "My subject"
    message.Body = "My content"
    Dim smtp As SmtpClient = New SmtpClient("myserver")
    smtp.Send(message)
+1  A: 

Why do you think you need to run these things on the database server. Your database is surely available across the network, yes?

If so, why not set up your own server box to run the queries and updates.

If you're saying that they're not going to allow you to run a scheduled task anywhere that will access the database, then any other automated solution will have the same problem.


As per your update, you are likely not permitted to connect to the SMTP server from another box (assuming your myserver value is correct in the first place). You will either have to convince the administrators of that box to allow you to access the mail server, or find another SMTP server for sending the mail.

In a corporate environment, that's probably easier than it sounds. There should be at least one kosher SMTP server floating around, you just need to find it. Alternatively, you may have to install a mail client on your own server box and use that for sending mail.

paxdiablo
Thanks for your messge. Actually when I run the executable in my computer the database gets updated. It is the email bit as I get an error (see Update above). Thanks again
netNewbi3