Skip to main content

Posts

Scheduling Email Using Sql Server

DECLARE @out_desc VARCHAR(1000), @out_mesg VARCHAR(10) DECLARE @name VARCHAR(20), @birthdate datetime, @email NVARCHAR(50) DECLARE @body NVARCHAR(1000) DECLARE C1 CURSOR READ_ONLY FOR SELECT [name], [birthdate], [email] FROM Customers OPEN C1 FETCH NEXT FROM C1 INTO @name, @birthdate, @email WHILE @@FETCH_STATUS = 0 BEGIN IF DATEPART(DAY,@birthdate) = DATEPART(DAY,GETDATE()) AND DATEPART(MONTH,@birthdate) = DATEPART(MONTH,GETDATE()) BEGIN SET @body = ' Happy Birthday ' + @name + ' Many happy returns of the day' + ' Customer Relationship Department' EXEC sp_send_mail sender@abc.com', 'xxxxxxx', @email, 'Birthday Wishes', @body, 'htmlbody', @output_mesg = @out_mesg output, @output_desc = @out_desc output PRINT @out_mesg PRINT @out_desc END ...

Updatepanel and JQuery

I am writing this article is just because my long struggle for combining JQuery with Updatepanel has been completed successfully. At initial point it wasn't working properly its because I was messing up all the wrong stuff together. It was problem neither with JQuery nor with UPdatepanel. Problem was lack of proper understanding of How UPDATE panel works. whenever the Jquery is used within the Updatepanel creates trouble when there is asynchronous post back request triggers, and the Jquery widgets got hanged . I spent plenty of time on googling and final reached some solutions, but I must say this solution is not perfect for all the cases in which the jquery creates the problem. what actually happen is when there is asynchronous post back. the ready function i.e. $(document).ready( function () { }); not get initialized every time and this is the headache. for that we have to do certain exercise as mentioned below. function FireOnLoad(){ Sys.WebForms.PageRequestManager.getI...