0

ObjectDataSource 'AddressesList' could not find a non-generic method 'DAL.AddressDBAccess.GetAddressList' that has no parameters.

this is the error I get
after googling lots of perople seem to have this type of error when they are inserting and updating but all im trying to to is bind the object.

What am i doing wrong??
im very new to this so maybe ive missed somethinbg really obvious

here is my mark up

 <asp:ObjectDataSource 
                ID="AddressesList" 
                runat="server"
                TypeName = "DAL.Address"
                SelectMethod =  "DAL.AddressDBAccess.GetAddressList" />


                <asp:GridView ID="grid" DataSourceID = "AddressesList" runat="server" 
                    allowsorting ="true" /> 

and here is my method with no parameters

`public List<Address> GetAddressList()
        {
            List<Address> listAddress = null;

            using (DataTable table = SqlDBHelper.ExecuteSelectCommand("sp_BL_AddressList",CommandType.StoredProcedure))
            {

                if (table.Rows.Count > 0)
                {
                    listAddress = new List<Address>();

                    foreach (DataRow row in table.Rows)
                    {
                        Address address = new Address();
                        address.ID = Convert.ToInt32(row["ID"]);
                        etc etc etc  Convert.ToInt32(row["Coadd"]);

                        listAddress.Add(address);
                    };


                }
            }

            return listAddress;
        }
2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by LastMitch
0

after googling lots of perople seem to have this type of error when they are inserting and updating but all im trying to to is bind the object.

Read this and used it's solution:

http://forums.asp.net/t/969187.aspx

That will remove the error: DataSet Error "Could not find a non generic method"

im very new to this so maybe ive missed somethinbg really obvious

There are some tutorial about it making it work correctly:

http://msdn.microsoft.com/en-us/library/aa581784.aspx

http://highoncoding.com/Articles/139_GridView_With_ObjectDataSource.aspx

http://www.codegod.com/Binding-an-ASP-NET-GridView-to-ObjectDataSource-AID478.aspx

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.