본문 바로가기

전체 글203

데이터그리드뷰 복사하기 'References to source and target grid. Dim sourceGrid As DataGridView = Me.DataGridView1 Dim targetGrid As DataGridView = Me.DataGridView2 'Copy all rows and cells. Dim targetRows = New List(Of DataGridViewRow) For Each sourceRow As DataGridViewRow In sourceGrid.Rows If (Not sourceRow.IsNewRow) Then Dim targetRow = CType(sourceRow.Clone(), DataGridViewRow) 'The Clone method do not copy the cell .. 2018. 10. 22.
데이터 그리드뷰 셀에 숫자만 입력되게 하기 Private Sub TextBox_keyPress(ByVal sender As Object, ByVal e As KeyPressEventArgs) If Char.IsDigit(CChar(CStr(e.KeyChar))) = False Then e.Handled = True End Sub Private Sub TextBox_keyPress1(ByVal sender As Object, ByVal e As KeyPressEventArgs) If Not (Char.IsDigit(CChar(CStr(e.KeyChar))) Or e.KeyChar = ".") Then e.Handled = True End Sub Private Sub Guide_DGV_EditingControlShowing(sender As Obje.. 2018. 10. 12.
VB.NET DataSet, DataReader DataSet - 한번 열면 여러번 사용가능 // 변수 선언Dim dSet As New DataSetDim cmd As New SqlCommand(Me.txtSENDQURY.Text, adoCon)Dim sqlAdapter As New SqlDataAdapter // DB에 쿼리전송sqlAdapter = New SqlDataAdapter(cmd) //DataSet에 데이터 채우기sqlAdapter.Fill(dSet, "MyTable") DataReader - 한번 열면 한번만 사용가능 // 변수 선언Dim cmd As New SqlCommand(Me.txtSENDQURY.Text, adoCon)Dim dr As SqlDataReader = cmd.ExecuteReader()Dim sqlAdapter As.. 2018. 10. 1.
VB.NET에서 정규식 사용하기 VB.NET 2008 에서 정규식 사용하기 정규식 클래스 : System.Text.RegularExpressions.Regex 예제1 - 일치하는 패턴 목록 구하기Dim regexPattern As String Dim regex As Regex Dim regexMatches As MatchCollection Dim strSource As String strSource = "~~~~~원본 문자열~~~~~" regexPattern = "(?([\x27]([l]|[L])([b]|[B])([l]|[L])_\w*[\x27])|([\x22]([l]|[L])([b]|[B])([l]|[L])_\w*[\x22]))" regex = New Regex(regexPattern) regexMatches = regex.Match.. 2018. 9. 17.