Click here to Skip to main content
15,887,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
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 
GeneralRe: search for date inf vb.net from excel to datagrid Pin
Mycroft Holmes4-Aug-13 23:35
professionalMycroft Holmes4-Aug-13 23:35 
GeneralRe: search for date inf vb.net from excel to datagrid Pin
hendrikbez5-Aug-13 20:27
hendrikbez5-Aug-13 20:27 
QuestionVB.net connect database MySQL online Pin
manoph30-Jul-13 21:49
manoph30-Jul-13 21:49 
AnswerRe: VB.net connect database MySQL online Pin
Eddy Vluggen31-Jul-13 8:54
professionalEddy Vluggen31-Jul-13 8:54 
GeneralRe: VB.net connect database MySQL online Pin
manoph31-Jul-13 23:36
manoph31-Jul-13 23:36 
GeneralRe: VB.net connect database MySQL online Pin
Eddy Vluggen1-Aug-13 9:03
professionalEddy Vluggen1-Aug-13 9:03 
QuestionReport with Crystal Report Pin
Biplob Singha Shee28-Jul-13 21:42
Biplob Singha Shee28-Jul-13 21:42 
SuggestionRe: Report with Crystal Report Pin
ZurdoDev9-Aug-13 8:01
professionalZurdoDev9-Aug-13 8:01 
QuestionDo I need to implement Dispose() ? Pin
David Mujica26-Jul-13 5:31
David Mujica26-Jul-13 5:31 
AnswerRe: Do I need to implement Dispose() ? Pin
Richard Deeming26-Jul-13 5:41
mveRichard Deeming26-Jul-13 5:41 
GeneralRefactoring my code now Pin
David Mujica26-Jul-13 8:03
David Mujica26-Jul-13 8:03 
QuestionCreate Dynamic Label with Drag and Drop Function Pin
Val Gerald Dela Cruz24-Jul-13 14:53
Val Gerald Dela Cruz24-Jul-13 14:53 
AnswerRe: Create Dynamic Label with Drag and Drop Function Pin
Dave Kreskowiak24-Jul-13 17:07
mveDave Kreskowiak24-Jul-13 17:07 
QuestionThree column autocomplete Combobox in form and datagridview Pin
Biplob Singha Shee23-Jul-13 19:44
Biplob Singha Shee23-Jul-13 19:44 
AnswerRe: Three column autocomplete Combobox in form and datagridview Pin
Eddy Vluggen31-Jul-13 8:59
professionalEddy Vluggen31-Jul-13 8:59 

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.