http://yugalpandya.wordpress.com/2013/09/30/custom-paging-user-control-for-large-amount-of-data-in-gridview/
Saturday, August 16, 2014
Friday, August 15, 2014
Elmah Error Logging Http Handler Links
http://www.hanselman.com/blog/NuGetPackageOfTheWeek7ELMAHErrorLoggingModulesAndHandlersWithSQLServerCompact.aspx
http://docs.nuget.org/docs/start-here/Using-the-Package-Manager-Console
Steps for apply elmah for Project (WebApplication - WebSite)
1- open your solution using visual studio.
2- Open Package Manager Console
3- Install-package elmah
4-install-package elmah.sqlserver
http://docs.nuget.org/docs/start-here/Using-the-Package-Manager-Console
Steps for apply elmah for Project (WebApplication - WebSite)
1- open your solution using visual studio.
2- Open Package Manager Console
3- Install-package elmah
4-install-package elmah.sqlserver
5- go to your solution folder and find Package Folder then elmah.sqlserver.1.2 you will find sql file
Elmah.SqlServer.sql
run the script to your sql server to create elmah database.
6- after creating elmah script on your sql server Change Connection String in your web.config to be linked to your sql server instance.
7- run your project to open elmah.axd to get errors occured as http errors
8- To Apply Elmah For All Solution to log All Errors you should write this code in your functions exception handling
try
{
// your function code
}
Catch ex As Exception
Elmah.ErrorSignal.FromCurrentContext().Raise(ex)
End Try
9- to enable send Mail Using Elmah to your Mail instead of monitor errors using elmah.axd
you should change mail configuration for elmah in your web.config
<elmah>
<security allowRemoteAccess="true" />
<errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ELMAH_CONSTR" />
<errorMail from="portal@mwa.gov.sa" to="msibrahim@mwa.gov.sa" subject="خطأ في البوابة الداخلية تجريبي" async="false">
</errorMail>
<errorFilter>
<test>
<or>
<regex binding="Exception.Message" pattern="^The operation has timed out$" />
<and>
<equal binding="HttpStatusCode" value="404" type="Int32" />
<equal binding="HttpStatusCode" value="504" type="Int32" />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
<and>
<regex binding="Exception.Message" pattern="^Logon failure: unknown user name or bad password" />
<regex binding="Exception.Message" pattern="^Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException: The Autodiscover service couldn't be located." />
<regex binding="FilterSourceType.Name" pattern="mail" />
</and>
</or>
</test>
</errorFilter>
</elmah>
10- you should edit your smtp mail server configuration in IIs Or your Web.config file
<system.net>
<mailSettings>
<smtp>
<network host="your smtp mail server" port="25" password="****" userName="******" />
</smtp>
</mailSettings>
</system.net>
11- now you will receive automatic mail when any error occurs for your web site.
thanks.
Thursday, August 14, 2014
SQL SERVER LOOP RESULT SET - QUERY BY TEMP TABLE SAMPLE CODE
BEGIN
Drop table #TEMP_STAGES_STAGES
Declare @P_STAGE_ID Varchar(20)
SET ROWCOUNT 0
SELECT STAGE_ID ,STAGE_NAME into #TEMP_STAGES FROM dbo.WORK_FLOWS_LOAD_CURRENT_STAGES_BY_ORDER_FUNCTION(3, 1, 2);
SET ROWCOUNT 1
Select @P_STAGE_ID = STAGE_ID from #TEMP_STAGES
While @@rowcount <> 0
Begin
select * from MEDICAL_REPORTS_APPROVAL_STAGES Where REQUEST_STAGE_ID = @P_STAGE_ID
PRINT(@P_STAGE_ID);
Delete from #TEMP_STAGES where STAGE_ID = @P_STAGE_ID
Select @P_STAGE_ID = STAGE_ID from #TEMP_STAGES
End
Set Rowcount 0
Drop table #TEMP_STAGES
END
Drop table #TEMP_STAGES_STAGES
Declare @P_STAGE_ID Varchar(20)
SET ROWCOUNT 0
SELECT STAGE_ID ,STAGE_NAME into #TEMP_STAGES FROM dbo.WORK_FLOWS_LOAD_CURRENT_STAGES_BY_ORDER_FUNCTION(3, 1, 2);
SET ROWCOUNT 1
Select @P_STAGE_ID = STAGE_ID from #TEMP_STAGES
While @@rowcount <> 0
Begin
select * from MEDICAL_REPORTS_APPROVAL_STAGES Where REQUEST_STAGE_ID = @P_STAGE_ID
PRINT(@P_STAGE_ID);
Delete from #TEMP_STAGES where STAGE_ID = @P_STAGE_ID
Select @P_STAGE_ID = STAGE_ID from #TEMP_STAGES
End
Set Rowcount 0
Drop table #TEMP_STAGES
END
Subscribe to:
Posts (Atom)