Click here to Skip to main content
15,906,463 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am currently using a Microsoft access database to store my virus signatures. I have added my binding source as "BindingSource1" and then added my dataset as "_Virus_Signature_Database_be___CopyDataSet" I then go to add both the MD5 table adapter and CRC32 table adapter named as follows, "MD5_Virus_DatabaseTableAdapter" & "CRC32_Virus_DatabaseTableAdapter". Everything so far has been added to my program by designer but I seem to be missing the connection string?.

When I go to load the program I get:

Invalid operation exception: The ConnectionString property has not been initialized.

Line of code on error line:

<pre lang="vb">'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database' table. You can move, or remove it, as needed.
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database' table. You can move, or remove it, as needed.
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)</pre>


This is the stack trace:

<pre lang="vb"> at System.Data.OleDb.OleDbConnection.PermissionDemand()
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry)
at System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
at System.Data.OleDb.OleDbConnection.Open()
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at _Virus_Signature_Database_be___CopyDataSetTableAdapters.CRC32_Virus_DatabaseTableAdapter.Fill(CRC32_Virus_DatabaseDataTable dataTable) in C:\Users\Admin\Desktop\File Enumerator VB.Net\_Virus_Signature_Database_be___CopyDataSet.Designer.vb:line 1368
at FileSystemEnumerator_Demo.FileFindForm.pathToSearchCombo_textChanged(Object sender, EventArgs e) in C:\Users\Admin\Desktop\File Enumerator VB.Net\FileFindForm.vb:line 46
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.ComboBox.set_Text(String value)
at FileSystemEnumerator_Demo.FileFindForm.InitializeComponent() in C:\Users\Admin\Desktop\File Enumerator VB.Net\FileFindForm.Designer.vb:line 105
at FileSystemEnumerator_Demo.FileFindForm..ctor() in C:\Users\Admin\Desktop\File Enumerator VB.Net\FileFindForm.vb:line 21
at FileSystemEnumerator_Demo.FileFind.Main() in C:\Users\Admin\Desktop\File Enumerator VB.Net\FileFind.vb:line 21
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
</pre>

Can or does anyone know how to open the connection in my case for a access database?.

thank you very much in advance!
Posted
Updated 30-Jan-12 2:47am
v2

Have a look at www.ConnectionString.com[^] would be a starting point as you haven't posted the offending code.
 
Share this answer
 
Comments
Dale 2012 30-Jan-12 9:29am    
Line of code on error line:

<pre lang="vb">'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database' table. You can move, or remove it, as needed.
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database' table. You can move, or remove it, as needed.
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)</pre>
Dale 2012 30-Jan-12 9:30am    
Where do I place the connection string? please advise?
Dale 2012 30-Jan-12 9:42am    
Ok i have Dim con As New OleDb.OleDbConnection and in my form load i have

con.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Admin\Desktop\File Enumerator VB.Net\bin\Debug\Virus Signature Database_be - Copy.accdb;Persist Security Info=False;"

but the same line of code errors again:

<pre lang="vb">'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database' table. You can move, or remove it, as needed.
Me.CRC32_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.CRC32_Virus_Database)
'TODO: This line of code loads data into the '_Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database' table. You can move, or remove it, as needed.
Me.MD5_Virus_DatabaseTableAdapter.Fill(Me._Virus_Signature_Database_be___CopyDataSet.MD5_Virus_Database)</pre>
Dale 2012 30-Jan-12 9:58am    
I am also using iterator functions........ Is there any known issues with this?
Dale 2012 30-Jan-12 9:58am    
I cannot figure out how or where to go with this
VB
[InvalidOperationException: The ConnectionString property has not been initialized.]
   System.Data.SqlClient.SqlConnection.PermissionDemand() +5316022
   System.Data.SqlClient.SqlConnectionFactory.PermissionDemand(DbConnection outerConnection) +20
   System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +143
   System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry) +83
   System.Data.SqlClient.SqlConnection.Open() +96
   System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +316
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +86
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1482
   System.Web.UI.WebControls.Repeater.GetData() +55
   System.Web.UI.WebControls.Repeater.CreateControlHierarchy(Boolean useDataSource) +89
   System.Web.UI.WebControls.Repeater.OnDataBinding(EventArgs e) +61
   System.Web.UI.WebControls.Repeater.DataBind() +105
   System.Web.UI.WebControls.Repeater.EnsureDataBound() +49
   System.Web.UI.WebControls.Repeater.OnPreRender(EventArgs e) +15
   System.Web.UI.Control.PreRenderRecursiveInternal() +83
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Control.PreRenderRecursiveInternal() +168
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +974
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900