C#71 C# 람다식으로 MSSQL FOR XML PATH 구현 예제 -0- string.Join 메서드를 이용하여 문자열을 결합 하였습니다-0- ex) Kim , Lee, Choi var result = de.SelectMany(c => Db.Users.Where(d => d.ID == c.ID), (c, d) => new { c, d }) .GroupBy(e => e.c.ID).Select(f => new { ID = f.Key, NAMES = string.Join(",",f.Select(g => g.d.UserName)) }); 2015. 12. 22. FileSystemWatcher를 이용한 파일 변경 및 생성 감시 간단한 예제!! 예제가 성의없어 죄송합니다 -_-;; FileSystemWatcher fswTEST = null; private void ViewerFrm_Load(object sender, EventArgs e) { InitControl(); EventHandler(); } private void InitControl() { fswTEST = new FileSystemWatcher(); // 파일을 감시할 경로 설정 fswTEST.Path = Path.GetPathRoot(Environment.SystemDirectory) + "watchFolder"; // txt 파일의 확장자만 검색 fswTEST.Filter = "*.txt"; } private void EventHandler() { //이벤트 핸들러 설정 fsw.. 2015. 12. 18. enum Flags Attribute static void Main() { PipeDirection d = PipeDirection.B | PipeDirection.C; Console.WriteLine(d); Console.WriteLine((int)d); } [Flags] public enum PipeDirection : uint { A = 0x01, B = 0x02, C = 0x04 } 16진수 B와 C를 더하면 6 결과는 B,C 6 Flags 를 주석 처리 하면 결과는 6 6 이 나옵니다 ;; 전 아직 정확히 이해를 못한상태입니다=0=;; 2015. 12. 1. Entity Framework ExecuteStoreQuery 를 이용하여 쿼리문이나 함수 실행 간단 예제 역시나 예제가 너무 성의 없어 죄송합니다 ;;; var result= Db.ExecuteStoreQuery("SELECT * FROM dbo.UFN_ProductList (@Param)" , new System.Data.SqlClient.SqlParameter { ParameterName = " Param", Value = " Parameter"}) 쿼리문에는 @Param 변수를 명시하고 SqlParameter를 이용해 Value 설정 2015. 11. 3. 이전 1 ··· 7 8 9 10 11 12 13 ··· 18 다음