Click here to Skip to main content
15,901,505 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: New to WPF. Getting frustrated Pin
beastmp1313-Aug-13 7:12
beastmp1313-Aug-13 7:12 
GeneralRe: New to WPF. Getting frustrated Pin
xcal13-Aug-13 7:23
xcal13-Aug-13 7:23 
GeneralRe: New to WPF. Getting frustrated Pin
beastmp1313-Aug-13 7:37
beastmp1313-Aug-13 7:37 
GeneralRe: New to WPF. Getting frustrated Pin
xcal13-Aug-13 8:22
xcal13-Aug-13 8:22 
GeneralRe: New to WPF. Getting frustrated Pin
beastmp1313-Aug-13 11:30
beastmp1313-Aug-13 11:30 
GeneralRe: New to WPF. Getting frustrated Pin
xcal13-Aug-13 7:19
xcal13-Aug-13 7:19 
Questionwild Search with insert Pin
sathish_v12-Aug-13 22:47
sathish_v12-Aug-13 22:47 
AnswerRe: wild Search with insert Pin
Tim Carmichael13-Aug-13 2:08
Tim Carmichael13-Aug-13 2:08 
QuestionMessage Closed Pin
10-Aug-13 22:03
Member 1020212110-Aug-13 22:03 
AnswerRe: Skype Brute Forcer? Pin
Richard MacCutchan10-Aug-13 22:54
mveRichard MacCutchan10-Aug-13 22:54 
GeneralRe: Skype Brute Forcer? Pin
Maciej Los10-Aug-13 23:16
mveMaciej Los10-Aug-13 23:16 
GeneralRe: Skype Brute Forcer? Pin
OriginalGriff10-Aug-13 23:42
mveOriginalGriff10-Aug-13 23:42 
GeneralRe: Skype Brute Forcer? Pin
Richard MacCutchan10-Aug-13 23:50
mveRichard MacCutchan10-Aug-13 23:50 
QuestionPropertyGrid PropertyValueChanged prevent fire of event Pin
InvalidEntry6-Aug-13 20:38
InvalidEntry6-Aug-13 20:38 
AnswerRe: PropertyGrid PropertyValueChanged prevent fire of event Pin
InvalidEntry7-Aug-13 20:56
InvalidEntry7-Aug-13 20:56 
Questioncriar coluna id auto_increment usando pragramaçao vb10 Pin
Pallinho5-Aug-13 12:21
Pallinho5-Aug-13 12:21 
SuggestionRe: criar coluna id auto_increment usando pragramaçao vb10 Pin
Richard MacCutchan5-Aug-13 20:52
mveRichard MacCutchan5-Aug-13 20:52 
AnswerRe: criar coluna id auto_increment usando pragramaçao vb10 Pin
Bernhard Hiller5-Aug-13 22:59
Bernhard Hiller5-Aug-13 22:59 
Questionclacultor Pin
eswaresh4-Aug-13 20:02
eswaresh4-Aug-13 20:02 
AnswerRe: clacultor Pin
Richard MacCutchan4-Aug-13 21:01
mveRichard MacCutchan4-Aug-13 21:01 
AnswerRe: clacultor Pin
anoop.palakkal6-Aug-13 21:10
anoop.palakkal6-Aug-13 21:10 
AnswerRe: clacultor Pin
Abhinav S7-Aug-13 1:45
Abhinav S7-Aug-13 1:45 
Questionsearch for date inf vb.net from excel to datagrid Pin
hendrikbez1-Aug-13 21:15
hendrikbez1-Aug-13 21:15 
I really need help with this.

1. I have a excel file with columns with text and some with only the date in it (07/16/2013). This date can be in more than one row.

2. I then have a form where I can display all the info in the form (Eg like if I choose server, it will show me that server info on the form with all the other details that goes with it.
I get the info form my excel file.

3. I then have a button to search for info eg Server names, it then make a data grid view and show my all the servers that start with eg. Prasa.

4. Now my problem is I cannot get it to search for a date. I need help with this.

Here is my main code and my button date search code.

Is the a sample of this or can someone help me with this.

VB
Imports System.Data.OleDb

Public Class Tapes_info
    Private dtGlobal As New DataTable


    Private Sub Tapes_info_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dtGlobal.Clear()
        Using cn As New OleDb.OleDbConnection
            Dim Builder As New OleDbConnectionStringBuilder With {.DataSource = IO.Path.Combine(Application.StartupPath, "Backuptapes.xls"), .Provider = "Microsoft.ACE.OLEDB.12.0"}
            Builder.Add("Extended Properties", "Excel 12.0; IMEX=1;HDR=No;")
            cn.ConnectionString = Builder.ConnectionString
            cn.Open()
            Using cmd As OleDbCommand = New OleDbCommand With {.Connection = cn}

                cmd.CommandText = "SELECT TOP 5130 F1 As Tapes, F2 As Containere, F3 as ContainerRef, F4 as DateOut FROM [Tapese$]"
                Dim dr As System.Data.IDataReader = cmd.ExecuteReader
                dtGlobal.Load(dr)
                LstTape.DisplayMember = "Tapes"
                LstTape.DataSource = dtGlobal
                txtContainer.DataBindings.Add("Text", dtGlobal, "Containere")
                txtContainerRef.DataBindings.Add("Text", dtGlobal, "ContainerRef")
                txtDateOut.DataBindings.Add("Text", dtGlobal, "Dateout")

            End Using
        End Using
    End Sub





Private Sub BtnSearchDateOut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSearchDateOut.Click

    For i As Integer = 0 To dtGlobal.Rows.Count - 1
        If IsDBNull(dtGlobal.Rows(i)("Dateout")) Then
            dtGlobal.Rows(i)("Dateout") = ""
        End If
    Next

    Dim query = From item In dtGlobal.AsEnumerable() Where item.Field(Of String)("Dateout").StartsWith(txtSearchDateOut.Text) Select item
    If query.Count > 0 Then
        Dim newDT As DataTable = query.CopyToDataTable()

        MsgBox(newDT.Rows.Count.ToString() & " Date out found.")

        Dim frm As New Form()
        Dim dgv As New DataGridView()
        dgv.DataSource = newDT
        dgv.Refresh()
        frm.Controls.Add(dgv)
        dgv.Dock = DockStyle.Fill
        frm.Size = New Size(1400, 700)
        frm.Show()

    Else
        MsgBox("There is no Date for this found.")
    End If

AnswerRe: search for date inf vb.net from excel to datagrid Pin
Mycroft Holmes4-Aug-13 21:10
professionalMycroft Holmes4-Aug-13 21:10 
GeneralRe: search for date inf vb.net from excel to datagrid Pin
Richard MacCutchan4-Aug-13 23:26
mveRichard MacCutchan4-Aug-13 23:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.