Hello, im new to VB.Net and im now in the process of trying to set up my first application to read/write to a MS Access database. So now i have a couple of q's. First my connection String
Dim CString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Brian\My Documents\Visual Studio Projects\adsfasd\Island_Delights.mdb;User Id=admin;Password=;"
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim strinsert As String
myConnection.ConnectionString = CString
^
When it gets to this point, it gives me a null reference error and the program stops. Ive checked an i know that the the Access file is there so whats wrong? As a side note, someone told me that as long as the Access file is located in the same directory as the program the Connection string could be simplified? This would work well since i plan on doing that in the future.
My second question has to do with reading in data from the DB. Basically this is an address book type application. I would like to read in all of the last names from the database into a drop down list box to which i can simply scroll to the last name i want and then select it to view the full information. This would make it easy to select the person you are looking for. How would i go about doing this??
Thanks all
Dim CString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents and Settings\Brian\My Documents\Visual Studio Projects\adsfasd\Island_Delights.mdb;User Id=admin;Password=;"
Dim myConnection As OleDbConnection
Dim myCommand As OleDbCommand
Dim strinsert As String
myConnection.ConnectionString = CString
^
When it gets to this point, it gives me a null reference error and the program stops. Ive checked an i know that the the Access file is there so whats wrong? As a side note, someone told me that as long as the Access file is located in the same directory as the program the Connection string could be simplified? This would work well since i plan on doing that in the future.
My second question has to do with reading in data from the DB. Basically this is an address book type application. I would like to read in all of the last names from the database into a drop down list box to which i can simply scroll to the last name i want and then select it to view the full information. This would make it easy to select the person you are looking for. How would i go about doing this??
Thanks all