posted by 네코냥이 2014. 2. 11. 07:30

using (SqlConnection sqlConn = new SqlConnection(conString))
{
SqlCommand cmd = new SqlCommand("저장프로시져명", sqlConn);
cmd.CommandType = System.Data.CommandType.StoredProcedure;

cmd.Parameters.Add("@저장프로시져 파라매터 변수명", SqlDbType.VarChar(저장프로시져 파라매터 변수 타입));
cmd.Parameters["@저장프로시져 파라매터 변수명"].Value = 값;

cmd.ExecuteNonQuery();
}

만약에 command명령을 여러번 반복적으로 날리실경우 cmd.Parameters.Clear();을 해주셔야합니다.

'.NET > C#' 카테고리의 다른 글

C# 바코드 라이브러리  (0) 2014.05.13
ASP.NET 2.0 DataTable => JSON 변환  (0) 2014.03.11
DB 트랜젝션  (0) 2014.02.08
XML 유효성 및 자식노드 개수 체크  (0) 2014.01.17
[C#] Anonymous Types in C#  (2) 2014.01.06
posted by 네코냥이 2014. 2. 10. 19:30

<%@ OutputCache Duration="#ofseconds"
   Location="Any | Client | Downstream | Server | None | 
     ServerAndClient "
   Shared="True | False"
   VaryByControl="controlname"
   VaryByCustom="browser | customstring"
   VaryByHeader="headers"
   VaryByParam="parametername" 
   CacheProfile="cache profile name | ''"
   NoStore="true | false"
   SqlDependency="database/table name pair | CommandNotification"
%>

Wrox Article _ Using the ASP.NET 2.pdf




'.NET > .NET' 카테고리의 다른 글

.NET 어플리케이션(웹) 일부만 중단시키기  (286) 2014.05.13
ASP.NET 생명주기 - 자료2  (149) 2014.03.19
[ASP.NET] 캐싱 개념  (145) 2014.02.09
[.NET] OnCommand  (0) 2014.02.02
.NET 페이지 리퀘스트 이벤트, 업데이트 패널시 사용.  (0) 2014.01.24
posted by 네코냥이 2014. 2. 9. 07:30


1. 캐싱(Caching) ?

  : 이미 처리된 데이터를  캐시에 넣는 행위를 말한다.

 

    (1) 캐싱기능

       ㄱ. 출력캐싱 - 페이지 처리 결과를 출력 캐시에 저장하고 사용자가 페이지를 다시 요청할때

                           페이지를 다시 처리하는 대신 출력 캐시에 저장된 결과를 다시 사용하는 캐싱기법

           - 출력캐싱기법 

              a. 전체페이지 캐싱 - 페이지 전체를 캐싱하는 기법 

                        <%@ OutputCache Duration="10" VaryByParam="none"&>

                         => .aspx 페이지를 10초간 출력 캐시에 저장하며, 매개변수를 통한 출력캐시는

                              사용하지 않겠다

                   @ OutputCache :  Duration, VaryByParam 특성을 지정해 줘야 한다.

 

              b. 부분페이지 캐싱 - 페이지의 일부분을 캐싱하는 기법

            

         ㄴ. 데이터 캐싱 - 사용자가 생성한 데이터 자체를 저장하는 캐싱기법

                               - 응용 프로그램 캐싱이라고도 한다.

 

    (2) 캐싱이 일어나는 순서

      1. .asp페이지를 최초로 요청하면 파서에 의해 .asp 페이지 구분을 분석하는 파싱 작업이

           일어난다.            

      2. 중간언어(IL)로 만드는 컴파일 작업이 일어난다.

      3. 생성된 중간언어는 어셈블리 캐시에 저장되고  메모리가 올려진 중간언어는 CLR에 의해

          실행된후 그 결과가 사용자에게 웹 페이지 형식으로 렌더링된다.

 

2. 캐시

  : 문맥상 명사(저장소) 또는 동사(저장하다)의 형태로 사용될수 있으므로 상황에 따라 캐싱과 동일한

    의미를 가진다.

  : 빠른 데이터 처리를 위해 이미 처리된 데이터를 임시적으로 저장해 두는 장소를 말한다.

 


posted by 네코냥이 2014. 2. 8. 07:30

using 문을 사용해서 연결객체를 인자로 넘기고 트랜잭션을 처리 할것이다.

아래는 그 예제에 대한 간단한 함수의 내용이다. 트랜잭션 클래스는 SqlTransaction 이며
SqlConnection 객체의 BeginTransaction 함수를 써서 시작한다. 그리고 리턴받은
SqlTrannsaction 객체로 Commit 함수를 호출해 실행한후 SqlConnection을 닫으면 된다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public void TotalDBExecute()
{
    string updateSql = "UPDATE Categories SET CategoryName = 'Car' WHERE CategoryID = 10";
    string deleteSql = "DELETE Categories WHERE CategoryID = 10";
    string conn = @"Server=222.232.2.22;Database=test;user=testuser;password=1111;Integrated Security=SSPI;";
 
    using (SqlConnection con = new SqlConnection(conn))
    {
        con.Open();
 
        // SqlTrasaction 클래스의인스턴스생성
        SqlTransaction tran = con.BeginTransaction(); // 트랜잭션시작
        SqlCommand cmd = new SqlCommand();
 
        cmd.Connection = con;
        cmd.Transaction = tran; // 현재사용할트랜잭션객체지정
 
        try
        {
            cmd.CommandText = updateSql;// 쿼리지정
            cmd.ExecuteNonQuery(); // 실행
 
            cmd.CommandText = deleteSql;
            cmd.ExecuteNonQuery();
 
            tran.Commit(); // 트랜잭션commit
        }
        catch (Exception ex)
        {
            tran.Rollback(); // 에러발생시rollback
        }
    }
}


'.NET > C#' 카테고리의 다른 글

ASP.NET 2.0 DataTable => JSON 변환  (0) 2014.03.11
DB 프로시저 실행  (0) 2014.02.11
XML 유효성 및 자식노드 개수 체크  (0) 2014.01.17
[C#] Anonymous Types in C#  (2) 2014.01.06
[C#] 델리게이트 일부내용  (0) 2014.01.06
posted by 네코냥이 2014. 2. 2. 22:07

http://msdn.microsoft.com/ko-kr/library/system.web.ui.webcontrols.button.commandargument(v=vs.110).aspx


그러하도다. 

스크립단에서 CommendArgument 값 수정불가.



Button.CommandArgument 속성 (System.Web.UI.pdf


posted by 네코냥이 2014. 1. 24. 10:38

var prm = Sys.WebForms.PageRequestManager.getInstance();

        prm.add_endRequest(function () {

            // 0.5초 지연

            //setTimeout(RefreshRow_DragEvent, 500);

            RefreshRow_DragEvent();

        });

'.NET > .NET' 카테고리의 다른 글

[ASP.NET] 캐싱 개념  (145) 2014.02.09
[.NET] OnCommand  (0) 2014.02.02
asp.net How to get the id of the button user clicked  (306) 2014.01.23
[ASP.NET] Life Cycle 문서링크  (0) 2014.01.06
Response.Redirect Vs Server.Transfer in ASP.Net  (0) 2013.12.30
posted by 네코냥이 2014. 1. 23. 14:05

I have a small problem. I am developing an online seat reservation system which allow users to click and select seats. I am using buttons for seats. I am writing a method for the button click event for all buttons. I need to know how to identify the id of the button, user clicked. thanks in advance.

share|edit|flag
add comment

When you use a button clicked event, the signature of the method that'll handle the event goes like this:

private void foo (object sender, EventArgs e)

sender in this case is the button that was clicked. Just cast it to Button again and there you have. Like this:

Button button = (Button)sender;
int buttonId = button.ID;

You an have all your buttons pointing their Click event to the same method like this.

share|edit|flag
1
 
Thanks. It worked –  LIH Jul 10 '13 at 15:02
add comment

The first parameter of your event handler (object source or sometimes object sender) is a reference to the button that was clicked. All you need to do is cast it and then you can retrieve the id value, e.g.:

void Button_Click(object sender, EventArgs e)
{
    Button button = sender as Button;
    if (button != null)
    {
       //get the id here
    }
}


posted by 네코냥이 2014. 1. 17. 11:32

// XML 유효성 및 자식노드 개수 체크


XmlDocument xml = new XmlDocument();

        try

        {

            xml.LoadXml(CATE_INIT_XML.ToUpper());

            if (

                xml.SelectNodes("/ROOT/DATA").Count > MAX_ITEM_CNT)

            {

                String alertMsg = "자식노드가 지정한 한계보다 많습니다.";

                // Alert(this, alertMsg);

               // return false;

            }

        }

        catch (XmlException xe)

        {

           //Alert(String.Format("XML 파싱오류 {0}-{1}", xe.LineNumber, xe.Message));

           // return false;

        }

        catch (Exception ex)

        {

            //Alert(String.Format("XML 파싱오류 {0}-{1}", "197", ex.Message));

            // return false;

        }

'.NET > C#' 카테고리의 다른 글

DB 프로시저 실행  (0) 2014.02.11
DB 트랜젝션  (0) 2014.02.08
[C#] Anonymous Types in C#  (2) 2014.01.06
[C#] 델리게이트 일부내용  (0) 2014.01.06
[C#] Read only and const variable  (0) 2014.01.06
posted by 네코냥이 2014. 1. 9. 11:19
xml 특수문자 처리 방법  JavaScript / Program. 

2011/02/23 08:49

복사http://50english.blog.me/40124005264

전용뷰어 보기

1. 공백문자.

수평 탭 : 09 
line-feed : 0A 
carrage-return: 0D 
ASCII space : 90
 

2. Escape 문자

& : &amp; 
< : &lt; 
> : &gt; 
' : &apos; 
" : &quot;

 

============================

특수문자 (Special Characters)

3. XML 예약문자 
<, >, &는 XML tag 표시와 entity를 표시하는 XML 예약문자로, XML 문서에 그대로 사용할 수 없기 때문에 다음과 같이 사용합니다.

s-than sign) &lt; 
> (greater-than sign) &gt; 
& (ampersand) &amp;


4. 그리스문자 
그리스 문자는 풀어서 사용합니다.

α alpha 
β beta 
γ gamma 
δ,Δ delta 
ε epsilon 
ζ zeta 
η eta 
θ theta 
ι iota 
κ kappa 
λ lambda 
μ micron 
ν nu 
ξ xi 
ο omicron 
π pi 
ρ rho 
σ, Σ sigma 
τ tau 
υ upsilon 
φ phi 
χ chi 
ψ psi 
ω, Ω omega


5. 기호 & 부호 
≤ &lt; or = 
≥ &gt; or = 
± +/- 
˚ degrees 
℃ degrees C 
→ --&gt; 
㎍, μG microgram 
㎕, μL microliter 
㎛, μM micrometer 
? (R) 
™ (TM) 
χ2 chi─square


6. 화학기호 
화학기호는 윗첨자나 아랫첨자를 지정하지 않고 그대로 입력합니다.
 
K+ K+ 
Cl- Cl- 
Mg2+ Mg2+ 
CO2 CO2 
H2O H2O


7. 수학기호 
수학기호는 윗첨자나 아랫첨자를 괄호 "( )" 안에 넣어서 입력합니다.


posted by 네코냥이 2014. 1. 7. 14:28

http://jqueryui.com/

http://jqueryui.com/sortable/


<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>