|
-
Jan 26th, 2015, 05:14 PM
#1
Thread Starter
Junior Member
[RESOLVED] Winging It But, Getting Trouble Selecting Data From Database
Hello, i hope someone here can help me with this. I'm not sure exactly how to get this done but i think i may be on the right track. I'm using Visual Studio Express 2013 and the ACE provider, i've figured out that in order to send commands to the dataset i need to go through a table adapter but i haven't gotten much further. In the program i want to query the database for specific entries but so far i've been stopped by an unhandled exception.
Code:
Public Function ConflictonCheck()
Dim media As New MediaODataSetTableAdapters.MediaO_Sort_DatabaseTableAdapter
media.Adapter.SelectCommand.CommandText = "SELECT * FROM [MediaO Sort Database]"
'I want to see what's being returned
MessageBox.Show(media.GetData.ToString)
End Function
The second line causes the IDE to display the following
An unhandled exception of type 'System.NullReferenceException' occurred in MediaO.exe
Additional information: Object reference not set to an instance of an object.
I'm not 100% sure of how to issue commands to the tableadapter so i just tried sending a broad selection statement for testing purposes, in actual use i'm going to need to specify to the sql statement some variables in the program. These are what the statement should search for so i'd like instruction on incorporating variables into it, i've seen a statement online which read ID = @ID. Is the @ an identifier for a variable within the program called ID ? I assumed the first ID was a table name.
Any assistance offered will be greatly appreciated, thank you.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|