본문 바로가기
반응형

Mizix131

나열형(enum)과 구조체(struct) 선언. 나열 형식 선언하기 enum Season { Spring, Summer, Fall, Winter } 나열형 변수 선언하기 Season currentSeason; 나열형 변수에 값 지정하기 currentSeason = Spring; //오류 currentSeason = Season.Spring //올바름 구조체 선언하기 struct Time { public Time(int hh, int mm, int cc) { … } … private int hours, minutes, seconds; } 구조체 변수 선언하기 Time now; 구조체 변수에 값 초기화하기 Time lunch = new Time(12, 30, 0); 2010. 7. 20.
JDK 1.6 + mssql 2005 연동하기. 마이크로소프트에 가서 mssql용 jdbc를 다운 받는다. sqljdbc_2.0.1803.100_kor.exe Connection conn=null; PreparedStatement pstmt = null; ResultSet rs = null; String sql = null; try{ String jdbcUrl="jdbc:sqlserver://주소:포트;DatabaseName=DB명"; String dbId="DB 접속 ID"; String dbPass="DB 접속 PASS"; Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver"); conn = DriverManager.getConnection(jdbcUrl,dbId,dbPass); sql = ".. 2010. 6. 25.
게시판 리스트 처리. 화면단. 회원 리스트 검색 : 아이디 이름 소스단. string strQuery = "select * from member"; private void DisplayData() { string strCon = "server=localhost;database=intra;uid=intra;pwd=intra"; MySqlConnection con = new MySqlConnection(strCon); MySqlCommand cmd = new MySqlCommand(strQuery, con); MySqlDataAdapter adapter = new MySqlDataAdapter(cmd); DataSet ds = new DataSet(); adapter.Fill(ds, "VC"); this.memberListCtl.. 2010. 6. 10.
Web.config에서 변수 선언해서 데이터베이스 연결주소 저장하기. Web.Config 파일을 열어서 appSettings를 다음과 같이 수정. 2010. 6. 9.
반응형