Question function overload trouble

armand21

Member
Joined
Jan 9, 2010
Messages
12
Location
casablanca
Programming Experience
3-5
Hello

I am having a little database of 2 tables (workshop and categories) that i have added to a project( which has 2 windows forms.The main form has a datagrid who will display the list of workshop at launching) and a button that will launch the second form (named DetailForm supposed to display all the details related to a workshop)
I have created a dataset including both tables. Inside the dataset i have added a new table adapter named Workshoplist and type the following TSQL code

SELECT Workshops.ID, Categories.Description AS Category, Workshops.Days, Workshops.Cost, Workshops.Description
FROM Categories INNER JOIN
Workshops ON Categories.ID = Workshops.CategoryID


The project has a middle tier class named Workshop in which i have typed the following code


Public Function Update(ByVal id As Short, ByVal categoryId As Short,
ByVal days As Short, ByVal cost As Decimal, ByVal description As String) As Boolean

Return adapter.Update(id, categoryId, days, cost, description) > 0
End Function

At the "Return line " i am having the following error message :

overload resolution failed because no accessible Update accepts this number of argument

Of course i went to check the dataset tableadapters :

1)workshopTableAdapter

SELECT ID, CategoryID, Days, Cost, Description
FROM Workshops



2)categoriestableadapter

Select Id,description from categories

3)tableadapter workshoplist getdata method




SELECT Workshops.ID, Categories.Description AS Category, Workshops.Days, Workshops.Cost, Workshops.Description
FROM Categories INNER JOIN
Workshops ON Categories.ID = Workshops.CategoryID



I dont know how to fix that trouble; any help will be appreciable

In advance thanks and regards

PS

All the 3 classes written in VB.NET are included in a text file .There are each 30 lines or less length
 

Attachments

  • Classes.txt
    3.5 KB · Views: 22
Back
Top