was looking for a little help on this one i'm doing the tutorial for 05 http://beta.asp.net/guidedtour2/ and i'm on page 14 adding update functionality, the code provided is generating an overload error for the way in which the .Update is being used. Here is the error I'm getting. Error 1 d:\Authors\App_Code\DataAccess.vb(23): error BC30516: Overload resolution failed because no accessible 'Update' accepts this number of arguments. /
Has anyone else come accross this or is there a correction out there somewhere that i'm missing?
Hi, Could you please post a snippet of the code that generates the error? Coz normally, this kind of error occurs when no overlaoded functions accepts the number of arguments that you are passing...
This is the code from my project it is just slightly different from what is in the tutorial Public Sub UpdateAuthor(ByVal au_lname As String, ByVal au_fname As String, ByVal phone As_ String, ByVal address As String, ByVal city As String, ByVal state As String, ByVal zip As String,_ ByVal contract As Boolean, ByVal Original_au_id As String) Dim authorsTableAdapter As New AuthorsDataSetTableAdapters.authorsTableAdapter authorsTableAdapter.Update(au_lname, au_fname, phone, address, city, state, zip, contract,_ Original_au_id) End Sub
Here is the code from the tutorial.
Public Sub UpdateAuthor(ByVal au_lname As String, ByVal au_fname As String, _ ByVal phone As String, ByVal address As String, ByVal city As String, ByVal state As String, _ ByVal zip As String, ByVal contract As Boolean, ByVal Original_au_id As String)
Dim authorsTableAdapter As New AuthorsDataSetTableAdapters.authorsTableAdapter authorsTableAdapter.Update(Original_au_id, au_lname, au_fname, phone, address, city, state, _ zip, contract, Original_au_id) End Sub
The only differene is I changed
authorsTableAdapter.Update(Original_au_id, au_lname, au_fname, phone, address, city, state, _ zip, contract, Original_au_id) To: authorsTableAdapter.Update(au_lname, au_fname, phone, address, city, state, _ zip, contract, Original_au_id) However I tried the code both ways in the editor, and it was an overload option. Should I be constructing another datatable or dataset to pass these update results through?
authorsTableAdapter.Update(au_lname, au_fname, phone, address, city, state, zip, contract,_ Original_au_id)
...then make sure you have the following columns in your GridView marked as ReadOnly=false...
au_lname au_fname phone address city state zip contract
...and DataKeyNames set to "au_id" and the au_id column set to ReadOnly=true. That should ensure the correct values are being passed to the tableAdapter. To help debug this, you can alway enumerate the parameters in the Updating event of the data source or gridview to see what is actually being passed. See the Data Parameters example at http://beta.asp.net/QUICKSTART/aspnet/doc/data/advanced.aspx#parameters
Hope this helps, Bradley Millington Web Platform and Tools Team, Microsoft
I as well am getting this error. Here is the code and data table
Public
Class DataAccess Public Function GetTrailers(ByVal Trailer As String) As TrailersDataSet Dim trailersTableAdapter As New TrailersDataSetTableAdapters.TrailersTableAdapter Dim trailersData As New TrailersDataSet()
trailersTableAdapter.Fill(trailersData.Trailers)
Return trailersData End Function Public Sub UpdateTrailers(ByVal Location As String, ByVal Status As String, ByVal Comments As String, ByVal Notes As String, ByVal Lane As String, ByVal vendor As String) Dim trailersDataTableAdapter As New TrailersDataSetTableAdapters.TrailersTableAdapter