허당 레몬도리
[Visual Basic] ODBC 연결문자 및 연결하기

ODBC 연결하다가 한참 삽질하다가 결국 연결했다 흐흐흐 ODBC 추가를 하고 필자의 구성사항 DNS종류:사용자 DSN 원본:MIcrosoft ODBC for Oracle 데이터 원본 이름 : "DDD"(사용하고자하는 이름)

타이틀바가 없는 윈도우폼 드레그

Private Sub Form_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown Dim xOffset As Integer Dim yOffset As Integer If e.Button = MouseButtons.Left Then xOffset = -e.X - SystemInformation.FixedFrameBorderSize.Width yOffset = -e.Y - SystemInformation.FixedFrameBorderSize.Height mouseOffset = New Point(xOffset, yOffset) isMouseDown = Tru..

article thumbnail
VB.Net Nothing 값 처리

배열이나 기타 변수에 Nothing의 값이 있는경우가 있다. 예를 들어 아래와 같이 Dim str(10) As String str(1) = "abcdefg..." str(2) = "zyx...." str(3) = "test...." For i As Integer = 0 To str.Length - 1 If Not str(i) Is Nothing Then MessageBox.Show(str(i)) End If Next 위와 같은 배열에 담긴 문자를 메시지박스에 보여주는 간단한 명령들이 있다. 10개의 방을 만들고 1,2,3번 방에 각각 값을 넣었다. 나머지 0, 4,5,6,7,8,9 번 방에 값을 확인 해보면 Nothing값이 들어있다. 위와 같은 화면을 볼수 있다. 방에 들어있는 값만 찍어 보고 싶다면 ..

한글을 두자리로 자르기

Function Cutstring(ByVal Text As String, ByVal startLenth As Integer, Optional ByVal Lenth As Integer = 0) As String Dim StringArray() As Byte '임시 바이트 배열 Lenth = IIf(Lenth = 0, System.Text.Encoding.GetEncoding("korean").GetByteCount(Text), Lenth) ' IIf(true/false, true 일경우 GetByteCount(Text)로 Text의 길이를 저장 , false일경우 lenth를 그대로 저장 StringArray = System.Text.Encoding.GetEncoding("korean").GetBytes(..

KeyDown Event 사용하기
가. 언어유형/Visual Basic 2008. 11. 17. 13:38

Form 속성에서 KeyPreview 값을 True로 선택한 뒤 Form Event에서 KeyDown 이벤트를 선택하고 아래와 같이 이벤트를 작성합니다. Private Sub _KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown Select Case e.KeyCode Case Keys.F1 '조회 CmdSearch_Click(sender, e) Case Keys.F2 '등록 CmdInsert_Click(sender, e) Case Keys.F3 '삭제 CmdDelete_Click(sender, e) Case Keys.F4 '종료 CmdExit_Click(sender, e) En..

Oracle Excute Messagebox
가. 언어유형/Visual Basic 2008. 11. 17. 11:55

Select Case 문자열 Case Insert '등록 If MsgBox("등록하시겠습니까?", MsgBoxStyle.OkCancel, "등록") = MsgBoxResult.Cancel Then Exit Sub End If Case Search '조회 If MsgBox("조회하시겠습니까?", MsgBoxStyle.OkCancel, "조회") = MsgBoxResult.Cancel Then Exit Sub End If Case Update '수정 If MsgBox("수정하시겠습니까?", MsgBoxStyle.OkCancel, "수정") = MsgBoxResult.Cancel Then Exit Sub End If Case Delete '삭제 If MsgBox("삭제하시겠습니까?", MsgBoxStyle.O..

Oracle Excute
가. 언어유형/Visual Basic 2008. 11. 17. 11:50

If CRUD = "I" Then Try Dim BamCommand As New OracleCommand(SQLCommandText, BamDataBase) Dim Excuted As Integer = BamCommand.ExecuteNonQuery() If Excuted = 1 Then WriteToStatusBar("정상적으로 등록되었습니다", MdiParent) End If Catch E As Exception OracleErrorMessage(E) End Try Else Dim BamCommand As New OracleCommand(SQLCommandText, BamDataBase) Try Dim myReader As OracleDataReader myReader = BamCommand.Exec..

어떤 Key가 눌렸지???
가. 언어유형/Visual Basic 2008. 10. 22. 14:16

KeyDown 이벤트를 만들어 봅시다 Private Sub KeyDown(ByVal sender As System.Object, ByVal e As System. Windows.Forms.KeyEventArgs) Handles .KeyDown '비주얼 베이직입니다. End Sub 버튼이 눌러졌을 때 어떤것이 뜨는지 확인 하려면 MessageBox.Show(e.keyCode) MessageBox.Show(e.shift) 찍어보시면 숫자로 뜨게 됩니다. 다음은 Ctrl + C 를 눌렀을때 발생하게 됩니다. If e.keyCode = 67 And e.shift = 2 Then MessageBox.Show("Ctrl + C") End If아래는 2005 이전에서 사용했던거 같습니다. 2005 이전버전이 없기에 ..