일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- jsp
- SpringSource Tool Suite
- scrollView
- 웹 서비스
- WebView
- 안드로이드
- MS-SQL
- Eclipse
- Apache Lucene
- asp.net
- 자바스크립트
- html
- Web Service
- STS
- 웹뷰
- Android
- Bootstrap
- Redirect
- 자바
- decompiler
- varags
- MANTIS
- TextBox
- Maven
- Java
- 컬럼명
- javascript
- MSsql
- C#
- 이클립스
- Today
- Total
목록C# (23)
bboks.net™
ExecuteScalar를 이용하면 SqlDataReader를 이용하지 않고도 Row Count를 얻을 수 있다. 일반적인 사용 방법은 int rowCount = SELECT Count(column_name) FROM table_name int rcds=0; sqlcmd.CommandText="Select count(*) from my_table where recdid='Active'"; rcds = sqlcmd.ExecuteScalar(); if(rcds>0) { sqlcmd.CommandText="Select Info1 from my_table where recdid='Active'"; myrdr = sqlcmd.ExecuteDataReader(); while(myrdr.Read()) { //Read..
//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("@par..