728x90
728x90
SMALL

Excel 6

[C#] Import Excel File To DataGridView

/// /// Import Excel File To DataGridView /// /// DataGridView Control /// Excel File Path /// if first row in excel is header is then yes else no /// 엑셀파일의 버전이 2003보다 큰지의 여부 /// 성공하면 에러메세지가 없고 그렇지않으면 발생한 에러 메세지를 반환함 string GridViewExcel(Systehttp://m.Windows.Forms.DataGridView grid, string sFilePath, string sSheetName = "Sheet1" , string sFirstRowHeader = "no", bool isExcelFileVersion2003 = f..

유용한 정보 2025.04.16

[C#] Excel to PrintPreview

/// /// 엑셀파일을 미리보기한다. /// /// 엑셀파일의 경로 /// 성공하면 에러메세지가 없고 그렇지않으면 발생한 에러 메세지를 반환함 string ExcelToPrintPreview(string sFilePath) { string sErrorMsg = string.Empty; Excel.Application xlApp = null; Excel._Workbook wb = null; Excel.Worksheet ws = null; try { xlApp = new Excel.Application(); //excelApp.ActivePrinter = PrinterSettings.InstalledPrinters[3]; wb = xlApp.Workbooks.Add(sFilePath); if (wb =..

유용한 정보 2025.04.16

[C#] Excel To Printer

/// /// 엑셀파일을 출력한다. /// /// 엑셀파일의 경로 /// 엑셀파일의 Sheet Name /// 프린터명 /// 성공하면 에러메세지가 없고 그렇지않으면 발생한 에러 메세지를 반환함 string ExcelToPrint(string sFilePath, string sSheetName = "", object printer = null) { string sErrorMsg = string.Empty; Excel.Application excelApp = new Excel.Application(); Excel.Workbooks wbs = excelApp.Workbooks; Excel._Workbook wb = null; Excel.Worksheet ws = null; try { excelApp.Di..

유용한 정보 2025.04.16

[MSSql] Excel 읽기, 불러오기

간혹 MS-SQL Server 에서 Excel 로 된 데이터파일을 읽어 오고 싶을때아래와 같이 실행하면 다음과 같은 오류가 발생한다.INSERT INTO KeyMapInit SELECT nFunctionNo, GETDATE(), NULL, nExtendedKey, nASCIICode, sDescriptionFROM OpenRowset('Microsoft.Jet.OLEDB.4.0','Excel 8.0;Database=d:\KeyMapInit.xls','SELECT * FROM `KeyMapInit$`') AS T1메시지 15281, 수준 16, 상태 1, 줄 1구성 요소 'Ad Hoc Distributed Queries'이(가) SQL Server 보안 구성의 일부로 해제되었으므로 이 구성 요소의 문 'O..

DB 관련 2024.12.27

[Ms-Sql]엑셀파일의 내용을 MsSQL Server에 가져오는 방법

--CONFIGURING SQL INSTANCE TO ACCEPT ADVANCED OPTIONSEXEC sp_configure 'show advanced options', 1;RECONFIGURE; GO --ENABLING USE OF DISTRIBUTED QUERIESEXEC sp_configure 'Ad Hoc Distributed Queries', 1;RECONFIGURE;GO --ADD DRIVERS IN SQL INSTANCEEXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', N'AllowInProcess', 1GO EXEC master.dbo.sp_MSset_oledb_prop N'Microsoft.ACE.OLEDB.12.0', ..

유용한 정보 2024.12.25

[C#] 엑셀파일을 데이터그리드컨트롤로(Import Excel File To DataGridView)

/// /// Import Excel File To DataGridView /// /// DataGridView Control /// Excel File Path /// if first row in excel is header is then yes else no /// 엑셀파일의 버전이 2003보다 큰지의 여부 /// 성공하면 true, 그렇지않으면 false public bool GridViewExcel(DataGridView grid, string sFilePath, string sFirstRowHeader = "no", bool isExcelFileVersion2003=false) { try { string sConn = string.Empty; string s..

기본카테고리 2015.04.23
728x90
728x90
LIST