일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- MSsql
- 컬럼명
- MS-SQL
- asp.net
- decompiler
- C#
- 안드로이드
- STS
- 이클립스
- 웹 서비스
- TextBox
- Bootstrap
- 자바
- SpringSource Tool Suite
- MANTIS
- Maven
- scrollView
- html
- WebView
- javascript
- Java
- Android
- 자바스크립트
- varags
- 웹뷰
- Eclipse
- jsp
- Web Service
- Apache Lucene
- Redirect
- 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..