Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27228

VS 2010 Selecting a single value in a column from Excel

$
0
0
Hi guys,

this is the code I have stumbled upon:
Code:

Connection = New System.Data.OleDb.OleDbConnection _
            ("provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & TextBox1.Text & ";Extended Properties=Excel 8.0;")

            MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", Connection)

            TextBox2.Text = ?????

From here, I understood that I'm selecting an Excel file, and I can display it through the datagrid (which I managed, that part was okay). How do I select only a specific value from a column? Let's say I want to take D20 and display it on the Textbox.

Thanks guys.
Vizier87

Viewing all articles
Browse latest Browse all 27228

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>