TableAdapters and Parameters ?

GaWill

Member
Joined
Feb 16, 2006
Messages
13
Location
South Wales
Programming Experience
Beginner
Ive used the datasource wizard etc and ive added the tables and created my query to filter my data. However in my query ive used a parameter called @BOOKED_DATE and im having trouble passing this parameter from my appliaction to the table adapter. Ive been trying using the following code :

VB.NET:
[SIZE=2]ClinicDate = [/SIZE][SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].TxtDate.Text
[/SIZE]
[SIZE=2][COLOR=#0000ff]Me[/COLOR][/SIZE][SIZE=2].CLINICTableAdapter.FillClinics.add([/SIZE][SIZE=2][COLOR=#800000]"@BOOKED_DATE"[/COLOR][/SIZE][SIZE=2], SqlDbType.DateTime, 10, [/SIZE][SIZE=2][COLOR=#800000]"BOOKED_DATE"[/COLOR][/SIZE][SIZE=2]).Value = ClinicDate
[/SIZE]

However it is not liking this code. Please can somebody tell me how to pass parameters into the wizard generated tableAdapters ?
 
You can add parameters to the OleDBCommand once you've found out what it's called. It looks like you are trying to add it to the DataAdapter. The PlaceHolders for the values yuo want to add as parameters in an oledbcommand appear in the SQL statement so therefore this is why you add the parameters to the oledbcommand parameters collection. The code would look similar to this...

VB.NET:
OleDBCommand.Parameters.add(.....)
 
If the question was by ZedEx yep its me ! (i post in more than one as tends to get quicker answers).

Anyway, Thank you so much for that info. Its solved my problem and its now working like a charm. You are a true gent !
 
Back
Top