Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

Connection Property Has Not Been Initialized Error

$
0
0

I am baffled as to why this is being thrown as I feel like that is what the line I set the connection in and the line I open the connection do....

string filePath = "C:\\Database\\Masterdatabase\\DB1.mdb"; System.Data.OleDb.OleDbConnection oledbconn = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet. OLEDB.4.0;Data Source=" + filePath); Oledbconn.Open(); OleDbCommand olecomm = new OleDbCommand("Select * from tbl_information, oledbconn");

System.Data.OleDb.OleDbDataReader dr = null;

//It hits here and error thrown

try { dr = olecomm.ExecuteReader(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); };





Viewing all articles
Browse latest Browse all 31927

Latest Images

Trending Articles



Latest Images

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