Configuring Email in SQL Server Express

Its a known issue that SQL Server express edition wont support Email . TO overcome this we can use CLR based email stored procedure.   Step 1 : Compile the VB code and convert as a dll. Code : Imports System.Net.Mail Public Class StoredProcedure <Microsoft.SqlServer.Server.SqlProcedure()> _ Public Shared Sub spSendMail(ByVal recipients As String, ByVal subject As String, ByVal from As String, ByVal body As String) Dim mySmtpClient As SmtpClient Using myMessage As New MailMessage(from, recipients) myMessage.Subject = subject myMessage.Body = body myMessage.IsBodyHtml = True mySmtpClient = New SmtpClient(“smtp.zxvzxvxzvx.com”) mySmtpClient.Credentials = New System.Net.NetworkCredential(“haneef@xcxzvcxzvz.com”, “vzxvxzvxzvz”) mySmtpClient.Send(myMessage) End Using End Sub End Class Step 2: Replace these 2 lines with your smtp username , password amd smtp server adress mySmtpClient = New SmtpClient(“smtpxxxxxxxx.com”) mySmtpClient.Credentials = New System.Net.NetworkCredential(“haneef@xxxxxxxx.com”, “Password”) Save the above file in d:\sendmail.vb Step 3: Complie the code using below command.   C:\Windows\system32>C:\Windows\Microsoft.NET\Framework\v4.0.30319\vbc /target:li brary D:\sendmail.vb The above will comile and create a file sendmail.dll in the same location. Step 4: Run this command in SQL management studio ALTER DATABASE msdb SET trustworthy ON Step 5: Create the assembly in SQL management studio   USE msdb GO CREATE ASSEMBLY SendEmail FROM ‘C:\SendEmail.dll’ WITH PERMISSION_SET = UNSAFE GO Step 6: Enable CLR sp_configure […]

» Read more

Install 2 Whatsapp in One Android Phone – Parallel Space

We always carry two mobile phones just for sake of 2 different accounts. Sometime we face this challenge if we have dual sim mobile still we carry the second mobile for purpose of whatsapp. Hereis the solution which will help you to clone any app and run as a second user. Search For Parallel Space in Android Playstore Android Application : https://play.google.com/store/apps/details?id=com.lbe.parallel.intl&hl=en     Features : Clone and run multiple accounts of the same app simultaneously, and use themes to style your unique space. As one of the top-ranked tools on Android, Parallel Space helps more than 90 million users log on multiple accounts at the same time on one device and highlight their own style. It also protects user privacy by making apps invisible on device with the Incognito Installation feature. Moreover, users are able to customize themes of their cloned apps and the themes of Parallel Space to style their own space. Parallel Space supports 24 languages, and be compatible with most Android apps. Get Parallel Space immediately to manage multiple accounts, protect privacy, and customize your own space. ★Log in to multiple accounts of social networking apps or game apps at the same time on one device • […]

» Read more

Integrating Google Recaptcha to Webid – Auction Script

Webid do not have built in support for new google Recaptcha . If use enable Recaptcha of webid your registration form may not work. To resolve this follow below steps.   Step 1 : Register for google Recaptcha https://www.google.com/recaptcha/admin Enter google username and Password   Once you register google will provide a site key , please make a note of it. Step 2 : Open the file themes/modern/global_header.tpl     .. If you are using different theme use concerned folder. Add This line exactly before the >/head> tag <script src=’https://www.google.com/recaptcha/api.js’></script> Step 3 : Open themes/modern/register.tpl   and replace below code   Replace below code block after replacing the site key <div class=”form-group col-lg-12″> <div class=”capchabox”>{CAPCHA}</div> </div> <!– CAPCHA CODE –> <div class=”form-group col-lg-12″> <div class=”g-recaptcha” data-sitekey=”SITE KEY HERE”></div> </div>     Now login to webid panel and disable captcha setting to now as below.   Now you open the home page in webid admin panel and click on clear cache as below Now open the registration page you will see the new Google recapcha version 2 as follows    

» Read more

SignalR – Real-time web communication between Client and Server Easy c# [Part 1 of 2]

What is SignalR ? ASP.NET SignalR is a new library for ASP.NET developers that makes developing real-time web functionality easy. SignalR allows bi-directional communication between server and client. Servers can now push content to connected clients instantly as it becomes available. SignalR supports Web Sockets, and falls back to other compatible techniques for older browsers. SignalR includes APIs for connection management (for instance, connect and disconnect events), grouping connections, and authorization. Features of this exercise after you complete: # Send real time message to client without client refreshing the page # Receive real time communication or message from client without refreshing the page. #Send message to all connected clients. # Send message to specific client. # Send message to all client except one who sent it… # This is a proof of concept …. you can extend it to the way you want…   How to Install SignalR to MVC C# ? Steps : Open Visual Studio 2015 Create New MVC Project Install SignalR from Nuget Package  – Install-Package Microsoft.AspNet.SignalR -Version 2.2.2 Create SignalR Hub Create Owin Startup File Create A view and include SignalR library reference Test the Application Extend the functionality to the ActionMethod       Testing the […]

» Read more

SignalR & Oracle DB Change Notification [Part 2 of 2]

What is Oracle change Notification ? The Oracle Data Provider for .NET provides a notification framework that supports Database Change Notification in the database server. Database Change Notification enables applications to receive notifications from a registered callback routine when there is a change in a query result set, schema objects, or the state of the database that could affect the results of a cached client result set. Using this feature in ODP.NET, an application can maintain the validity of the client-side cache (for example, the ADO.NET DataSet) easily. The client does not need to maintain a connection to the database. It will receive notifications even when no longer connected to the database. This feature is intended for queries whose results change infrequently over time and for those who cannot maintain a large number of active database connections. Features you get after you complete this tutorial # Send real time message to any user for change in DB # Alert about the operation like update / insert / delete # Alert about any changes based on the SELECT statement defined. # Functionality can be extended to any ticket selling systems, room booking systems where you wish to block the booking based […]

» Read more

Oracle PL/SQL to check whether variable is text or number

Issue : sometime its very important to check a variable is number or text in order to avoid any exception. Assume your variable is xyz SELECT DECODE(TRIM(TRANSLATE(xyz,’0123456789′,’  ‘)), NULL, ‘number’,’characters’) FROM DUAL; SELECT DECODE(TRIM(TRANSLATE(’12s3456′,’0123456789′,’ ‘)), NULL, ‘number’,’characters’) FROM DUAL; Returns : characters SELECT DECODE(TRIM(TRANSLATE(‘1233456′,’0123456789′,’ ‘)), NULL, ‘number’,’characters’) FROM DUAL; Returns : number What is Translate Function: For example, it will replace the 1st character in the string_to_replace with the 1st character in the replacement_string. Then it will replace the 2nd character in the string_to_replace with the 2nd character in the replacement_string, and so on. TRANSLATE(‘1tech23’, ‘123’, ‘456’) Result: ‘4tech56’ TRANSLATE(‘222tech’, ‘2ec’, ‘3it’) Result: ‘333tith’

» Read more

Oracle pl/sql dynamic query with IN paramters

Issue: Sending dynamic paramter to oracle pl/sql. Example : you will pass a paramter of employee names to the procedure and you want to dynamically construct the SQL query. Parameter Passed : v_emp   Value Passed : v_emp = ‘haneef,ganesh,rajesh,minaal’   This query will not work:   SELECT emp_id, emp_name from, FROM EMP_TABLE WHERE emp_name IN v_emp;   Working Query  SELECT emp_id, emp_name from, FROM EMP_TABLE WHERE emp_name IN (SELECT EXTRACTVALUE (xt.COLUMN_VALUE, ‘e’) FROM TABLE ( XMLSEQUENCE ( EXTRACT ( xmltype ( ‘<coll><e>’ || REPLACE (v_emp, ‘,’, ‘</e><e>’) || ‘</e></coll>’), ‘/coll/*’))) xt) ORDER BY emp_id ASC;        

» Read more
1 2 3 43