Posts

Showing posts from August, 2012

Memcached Caching

Image
Tools
MemCacheD Manager v1.0.3.0 as Memcached Server Enyim Memcached Client as Memcached .Net Client Library (Add these references to your project: Enyim.Caching.dll, log4net.dll, MemcachedProviders.dll)Your Client ProgramMemCacheD Manager
Run the setup file and configure a Memcached Server as shown below:

Client Program
Create a new .Net project and add these settings to web.config file as shown below:<configSections> <sectionname="cacheProvider"type="MemcachedProviders.Cache.CacheProviderSection,MemcachedProviders"allowDefinition="MachineToApplication"restartOnExternalChanges="true"/> <sectionGroupname="enyim.com"> <sectionname="memcached"type="Enyim.Caching.Configuration.MemcachedClientSection, Enyim.Caching"/> </sectionGroup> <sectionname="log4net"type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/> </configSections>

<enyim.com> <memcached&…

Data Caching

Image
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WACashingTester._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
        <br />
        <asp:GridView ID="GridView1" runat="server">
        </asp:GridView>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <asp:Timer ID="Timer1" runat="server" Interval="1000&qu…

Solution for the fault: "System.Diagnostics.Process.Start is not working on IIS, but working on ASP.NET Development Server"

Image
If there isn't any problem on the code side, then the reason can be about authentication and privileges settings. You need to adjust them as well.

Here is the solution:

You can reach my sample program from this link: http://www.nurhak-kaya.blogspot.com/2012/08/process-worker-web-service-exe-starter.html
Run the Internet Information Services (IIS) Manager serviceGo to Application PoolsSelect the user DefaultAppPool and from Advanced Settings on the right side of the menu, change the Identity column as LocalSystem. This default user can be different in your working environment but for most of the developers this is going to be the user.


Right click on DefaultWebSite (or here can be different according to your project name), choose Add Application and after setting the allias and path, click on Connect As button. Choose Specific user option and then Set the credentials for your application. This user must have rights to run this service on IIS. For your local machine, these can be: Your…

Creating relations between tables in Oracle

create table CATEGORIES
(
  CATEGORYID number primary key,
  CATEGORYNAME varchar2(50),
  CATEGORYDESCRIPTION varchar2(50)
);


create table PRODUCTS
(
  PRODUCTID number primary key,
  PRODUCTNAME varchar2(50),
  PRODUCTDESCRIPTION varchar2(250),
  CATEGORYID number CONSTRAINT PRODUCTCATEGORYID
  REFERENCES CATEGORIES(CATEGORYID)
);



A Stored Procedure of selecting the contents of a ref cursor as part of a SQL Select statement

CREATE OR REPLACE PROCEDURE TESTPROCEDURE (v_refcur IN OUT SYS_REFCURSOR)
IS
BEGIN
  OPEN v_refcur FOR SELECT * FROM regions;
END TESTPROCEDURE;

A Function of selecting the contents of a ref cursor as part of a SQL Select statement

CREATE OR REPLACE
FUNCTION TESTFUNCTION RETURN sys_refcursor
IS
c1 sys_refcursor;
BEGIN
open c1 for select * from regions;
  return c1;
END TESTFUNCTION;


How to Create a Stored Procedure in Oracle

CREATE OR REPLACE PROCEDURE REGIONADD
(
  p_region_name regions.region_name%type
)
IS
BEGIN
  INSERT INTO regions(region_name) VALUES(p_region_name);
END REGIONADD;

How to Create a Function in Oracle

CREATE OR REPLACE FUNCTION TESTBYNAME2(XKENTLI_AD VARCHAR2)  RETURN VARCHAR2 IS     XBABAADI VARCHAR2(50); BEGIN     SELECT BABA_ADI INTO XBABAADI FROM ORT_KENTLI WHERE ADI=XKENTLI_AD AND ROWNUM=1;       IF xbabaadi='MEHMET' THEN         XBABAADI:='KASIM';       END IF; RETURN XBABAADI;
END;

Process Worker Web Service (.exe Starter)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.IO;
using System.Diagnostics;
using System.Security.Principal;
using System.Security;
using System.Runtime.InteropServices;

namespace ProWS
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class Pro: System.Web.Services.WebService
    {

        [WebMethod]
        public bool ProWorker(string filePath)
        {

            string htm = ".htm";
            string iFileName = Path.GetFileName(filePath);
            string oFileName = iFileName.Substring(0, iFileName.Index…

How to Create Auto-Increment Field in Oracle

Create a sample table.

CREATE  TABLE SAMPLETABLE (   TABLEID  number,   TABLEDATA  varchar2(20) );
Create a new sequence.

CREATE SEQUENCE SEQ_SAMPLETABLE_ID START WITH 1 INCREMENT BY 1 ;
Create a new trigger.

CREATE OR REPLACE TRIGGER TRIGGER_SAMPLETABLE  BEFORE INSERT ON SAMPLETABLE  FOR EACH ROW BEGIN   SELECT SEQ_SAMPLETABLE_ID.NEXTVAL INTO :NEW.TABLEID FROM dual; END;