I was trying to make a database connection in a windows application using vb.net in vs2005
The following code did'nt work------------------!!!!!
1. Inherits System.Data.OleDb
Error displayed: Statement is not valid in a namespace.
My Comments: I wanted to include the above class to use the components of OleDb data provider. But since it did'nt work, I made a connection via the server explorer window...and anyhow the connection was successfully made.
But what is wrong with the above code, incase I want to make a connection with MS access database manually?
2. Whenever I try to create a data adapter by writing the following code -
oledb.oledbDataAdapter myadapt = new oledb.oledbDataAdapter()
On pressing "Enter" an unusual thing happens...the above written code gets converted into something like this-----
OleDb.OleDbDataAdapter(myadapt = New OleDb.OleDbDataAdapter())
What is the mistake that I am making?
Also I don't know what arguments are to be passed to the dataAdapter object(myadapt) that I am trying to create as the name of the connection created is not known to me.
In all, I am finding it difficult to make a database connection in vs2005, manually.
However, using a wizard for the same is not creating any problems but please let me know if I am missing out any code.