Skip to main content

Posts

Showing posts from 2012

Set Popup in center of window

<script type="text/javascript">         $(document).ready(function() {             //select all the a tag with name equal to modal             $('a[name=modal]').click(function(e) {                 //Cancel the link behavior                 e.preventDefault();                 //Get the A tag                 var id = $(this).attr('href');                 //Get the screen height and width                 var maskHeight = $(document).height();                 var maskWidth = $(window).width();                 //Set heigth and width to mask to fill up the whole screen                 $('#mask').css({ 'width': maskWidth, 'height': maskHeight });                 //transition effect                        $('#mask').fadeIn(1000);                 $('#mask').fadeTo("slow", 0.8);                 //Get the window height and width                 var winH = $(window).height();                 var winW = $(window).wi

Get Client Ip in Asp.Net

private string GetClientIP() { System.ServiceModel.Channels.RemoteEndpointMessageProperty clientEndpoint = System.ServiceModel.OperationContext.Current.IncomingMessageProperties[ System.ServiceModel.Channels.RemoteEndpointMessageProperty.Name] as System.ServiceModel.Channels.RemoteEndpointMessageProperty; return String.Format( "{0}:{1}", clientEndpoint.Address, clientEndpoint.Port); }

Create Linked Server using T-SQL

Create Linked Server using T-SQL While the linked server can be created using the built-in wizard of the Management Studio, it can also be created using TSQL statements as in the following listing (run both statements, the first one creates the linked server and the second the logins). Exec master.dbo.sp_addlinkedserver @server=N’localhost’, @srvprodcut=N’MySQL’, @provider=N’MSDASQL’, @datasrc=N’MySQL’ Exec master.dbo.sp_addlinkedserverlogin @server=N’localhost’, @locallogin=NULL, @rmtuser=N’user’, @rmtpassword=N’<your password>’ @rmtsrvname=N’localhost’

Configure Database Mail - Send Email From SQL Database

http://www.codeproject.com/Articles/29060/SQL-SERVER-2008-Configure-Database-Mail-Send-Email 1. create profile 2.  configure email      run this code for configure     sp_CONFIGURE 'show advanced', 1    GO    RECONFIGURE    GO    sp_CONFIGURE 'Database Mail XPs', 1    GO    RECONFIGURE    GO 3. Send mail EXEC sp_send_dbmail @profile_name= 'Test' , @recipients= 'test@example.com' , @subject= 'Test message' , @body= 'This is the body of the test message. sent through DataBase mail'