본문 바로가기

Visual Studio/C#

[iBatis.NET] SqlMap 관련팁 : SqlMap을 보다 쉽게 정의해보자 iBatis.NET 을 하다보면 sqlmap 을 정의하는것이 가장 중요한 작업중에 하나 입니다. 이때 sqlmap xml 에서 mapper 정의하고 파라메터 클래스 mapper 정의하고 result mapper 정의하고 .. 만일 vo 클래스 속성명이라도 고칠라고 하면 .. xml 뜯어서 mapper 정의 다시 고치고.. 에러나면 찾기도 힘들것입니다. 별것 아니지만 간단하고 깔끔하게 sqlmap 을 정의할 수 있고 수정 공수도 줄일 수 있습니다. 1) resultMap 대신 resultClass를 사용합니다. 다음 예제를 참조 2) 파라메터 클래스는 Dictionary 를 사용합니다. 파라메터 클래스를 모두 만들거나 ReusltMap 으로 정의한다면 참으로 비효율적일 것입니다. 결과에 비해 파라메터는 양.. 더보기
jQuery를 사용하여 ASP.NET AJAX Web Service 호출하기 예제 [출처] jQuery를 사용하여 ASP.NET AJAX Web Service 호출하기 예제|작성자 파로스 닷넷을 사용하면서 제일 불편하고 짜증나는 것 중에 하나가 쓸데없는 코드가 너무 많다는 것과 애매모호한 PostBack 이다. jQuery를 사용하면서 그런 느낌은 더욱 심해졌다. 그래서 사용한 방식이 서버단 처리를 모두 제네릭 처리기로 하였는데 뭔가 다른 방법을 써 보고 싶었다. MVC가 요즘 뜨는거 같아서 그거로 할까 알아봤지만 뷰가 완전히 독립된 것이 아닌 닷넷 코드 혼합이다. 내가 원하는 것은 닷넷 코드가 전혀 들어가지 않은 순수 html + javascript + css로만 구성된 뷰페이지를 구성하는 것이다. 그래서 나온 결론은 웹서비스! 하지만 웹서비스는 기본으로 XML을 지원한다. JSON.. 더보기
C# MD5 해쉬값 생성 public static string MD5(string password) { byte[] textBytes = System.Text.Encoding.Default.GetBytes(password); try { System.Security.Cryptography.MD5CryptoServiceProvider cryptHandler; cryptHandler = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] hash = cryptHandler.ComputeHash (textBytes); string ret = ""; foreach (byte a in hash) { if (a 더보기
fdmkajluia;dskla;fmd using Excel = Microsoft.Office.Interop.Excel; ExcelSaveDialog.Title = "저장"; ExcelSaveDialog.CreatePrompt = true; ExcelSaveDialog.OverwritePrompt = true; ExcelSaveDialog.FileName = dirPath.Substring(0, 4) + "년" + dirPath.Substring(4, 2) + "월" + dirPath.Substring(6, 2) + "일" + dirPath.Substring(8, 2) + "시" + dirPath.Substring(10, 2) + "분수검로그"; ExcelSaveDialog.DefaultExt = "xls"; ExcelSaveDialog.Fi.. 더보기
ASPxUploadControl을 이용한 파일 컨트롤 protected void ASPxFileUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FileUploadCompleteEventArgs e) { string strFilePath = "/"; string strFileInfo = strFilePath + strFilename; if (e.UploadedFile.IsValid) { try { e.UploadedFile.SaveAs(strFileInfo); } catch (Exception ex) { string strErr = ex.Message.ToString(); throw; } } } Description 이 알기 쉽게 설명되어 있음. 더보기