Question How can I change this example from web application to windows applecation!

totab3

New member
Joined
Apr 11, 2009
Messages
4
Programming Experience
1-3
How can I change this example from web application to windows applecation!

Please anyone help me with an example :confused:

the web application example is attached bellow :)

Note: I want to import an excel cells into many textboxes, by filtering! :confused:

thx :rolleyes:
 

Attachments

  • codeForex.zip
    30.1 KB · Views: 32
Hi there!

I have check it :confused: I didn't understand it really

I have find this code I need anyone to help me with an example !!!


VB.NET:
Private Sub Load1_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles Load1.LinkClicked
        DataGridView1.DataSource = Nothing
        Dim sFilePath, sFileName As String
        Dim sSlash As Single
        Dim strFileName As String
        Dim strFilePath As String
        OpenFileDialog1.Filter = "MetaTrader (*.csv)|*.csv|TradeStation (*.xml)|*.xml"
        If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
            sSlash = InStrRev(OpenFileDialog1.FileName, "\")
            sFilePath = Mid(OpenFileDialog1.FileName, 1, sSlash)
            sFileName = Mid(OpenFileDialog1.FileName, sSlash + 1, Len(OpenFileDialog1.FileName))
            '====================
            Dim strConnection As System.Data.OleDb.OleDbConnection
            Dim myPath As String = sFilePath & sFileName
            Dim objDataSet As System.Data.DataSet
            Dim objAdapter As System.Data.OleDb.OleDbDataAdapter
            Try
                strFilePath = Mid(OpenFileDialog1.FileName, 1, sSlash)
                strFileName = Mid(OpenFileDialog1.FileName, sSlash + 1, Len(OpenFileDialog1.FileName))
                filename.Text = Mid(strFileName, 1, strFileName.Length - 4)
                filename.Text = Mid(strFileName, 1, strFileName.Length - 4)
                strConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source='" & myPath & " '; " & "Extended Properties=Excel 8.0;")
                objAdapter = New System.Data.OleDb.OleDbDataAdapter("SELECT top 10 * FROM [Sheet1$]", strConnection)
                objDataSet = New System.Data.DataSet
                objAdapter.Fill(objDataSet)
   
             DataGridView1.DataSource = objDataSet.Tables(0).DefaultView
                DataGridView1.DataBindings.ToString()
                
                strConnection.Close()

            Catch
            Finally
                Dim er As String
                strConnection.Close()
            End Try
            z1.Text = DataGridView1.Rows(9).Cells(4).ToString
           z2.Text = DataGridView1.Rows(8).Cells(4).ToString
            z3.Text = DataGridView1.Rows(7).Cells(4).ToString
            z4.Text = DataGridView1.Rows(6).Cells(4).ToString
            z5.Text = DataGridView1.Rows(5).Cells(4).ToString
            z6.Text = DataGridView1.Rows(4).Cells(4).ToString
            z7.Text = DataGridView1.Rows(3).Cells(4).ToString
            z8.Text = DataGridView1.Rows(2).Cells(4).ToString
            z9.Text = DataGridView1.Rows(1).Cells(4).ToString
            z10.Text = DataGridView1.Rows(0).Cells(4).ToString
        End If
 
Back
Top