Advertisement
eleazar05

Connection String

Mar 18th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.50 KB | None | 0 0
  1. MyConnection = New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +
  2.                                                          ofd.FileName + ";Extended Properties=Excel 12.0;")
  3.                 MyCommand = New OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
  4.                 MyConnection.Open()
  5.                 dataSet = New DataSet
  6.                 MyCommand.Fill(dataSet)
  7.                 dt_data.DataSource = dataSet.Tables(0)
  8.  
  9.                 MyConnection.Close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement