oleDbConnectionStringBuilder sbConnection = new OleDbConnectionStringBuilder(); sbConnection.DataSource = System.IO.Path.GetDirectoryName(txt_selectDirectory.Text); sbConnection.Provider = "Microsoft.ACE.OLEDB.12.0"; String strExtendedProperties = String.Empty; strExtendedProperties = String.Format("Text;IMEX=1;FMT=Delimited", "NO"); sbConnection.Add("Extended Properties", strExtendedProperties); String filename = System.IO.Path.GetFileName(txt_selectDirectory.Text); OleDbDataReader datareader; System.Data.OleDb.OleDbConnection connection = new System.Data.OleDb.OleDbConnection(sbConnection.ToString()); System.Data.OleDb.OleDbCommand command = new System.Data.OleDb.OleDbCommand(String.Format("Select * FROM [{0}]", filename), connection); connection.Open(); command.CommandTimeout = 0; datareader = command.ExecuteReader();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)