Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- scrollView
- STS
- varags
- 자바
- Java
- decompiler
- Web Service
- 웹 서비스
- C#
- Maven
- asp.net
- 자바스크립트
- 웹뷰
- html
- MANTIS
- jsp
- SpringSource Tool Suite
- Eclipse
- 안드로이드
- TextBox
- MS-SQL
- Android
- 컬럼명
- javascript
- 이클립스
- WebView
- Bootstrap
- MSsql
- Redirect
- Apache Lucene
Archives
- Today
- Total
bboks.net™
C#에서 저장프로시저 사용하기 본문
//Connection SqlConnection con = new SqlConnection(); con.ConnectionString = ConfigurationManager.ConnectionStrings["연결문자열"].ConnectionString; con.Open(); //Command SqlCommand cmd = new SqlCommand(); cmd.Connection = con; //사용할 프로시저 cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "sp 이름"; //입력 파라미터 cmd.Parameters.AddWithValue("@param1", "1234"); cmd.Parameters.AddWithValue("@param2", "5678"); //출력 파라미터 cmd.Parameters.Add("@out_param1", 디비타입.출력형식, 길이).Direction = ParameterDirection.Output; cmd.Parameters.Add("@out_param2", 디비타입.출력형식, 길이).Direction = ParameterDirection.Output; //출력 파라미터 사용 예 cmd.Parameters.Add("@a", SqlDbType.VarChar, 9).Direction = ParameterDirection.Output; cmd.Parameters.Add("@b", SqlDbType.VarChar, 255).Direction = ParameterDirection.Output;
[출처] Captain Of my Soul is JH