MVC :: Method Not Found: 'System.Collections.Generic.IDictionary`2
Mar 10, 2010
I dont know what I have done but my add blog or news item functionality is broken. It works fine locally but not on the server (.net 3.5 mvc 2 I believe).
[Code]....
The interesting thing is the path P:Web_DevelopmentAHNDEVControllersAdministratorController.vb. This is my local path on my machine but not the
However, when I try to build the control I'm getting the error as shown in the subject. I've tried searching, and it seems the signature for the original function matches the one I have, and all other solutions I've seen uses the same signature.
Calling Index view is giving me this very very annoying error . Can anybody tell me what to do about it
Error:The model item passed into the dictionary is of type 'System.Collections.Generic.List1[MvcApplication13.Models.Groups]', but this dictionary requires a model item of type 'MvcApplication13.Helpers.PaginatedList1[MvcApplication13.Models.Groups]'.
public ActionResult Index(int? page) { const int pageSize = 10; [code].....
At debug time I would like to see what are the keys in my InitParams collection - I can't seem to be able to list them.
EDIT:As Jon suggests below, this might be a bug within the Silverlight debugger. To reproduce, just create a new Silverlight Application within Visual Studio 2010 and just edit code
{ public partial class MainPage : UserControl { [code]...
How to use Generic collection and generic list effectively in a asp.net application i.e. web application.? Can we able to use Generic list in Dataset or Datatable or Datareader using to bind in Grid view?
I am trying to create my own membership system. Therefore I created my own membershipuser class and membership provider class. But I am getting the following error on Createuser method of My membership provider class; no suitable method found to override
This is how my CreateUser method looks like:
public override MyMembershipUser CreateUser(string username, string password, string email, string status, int registerd_on, out UserCreationStatus creation_status)
I want to do paging the API Membership without using the datacontrols, but I get this error "Unable to cast object of type '<TakeIterator>d__3a`1[System.Char]' to type 'System.Collections.IList'." when I do this,
I am having a lot of the same issue as this poster did with errors on initializing type.
I am trying to learn linq and am about ready to give up - don't get how this is easier...
I'm trying to do a simple update to product names in the product table based on the manufacturer ID
In order to do this I am looping through each record. I was initally successful with changing all names in the column but when I try to query the data, I continually run into multiple problems.
The following poster has had the same issue I have but his solution isn't working for me.
[URL]
I keep getting the same error on the opening bracket on the select statement in the SelectByManufacturerID function...
Error 1 Cannot initialize type 'DataBaseDataManagement.ProductName' with a collection initializer because it does not implement 'System.Collections.IEnumerable'
Button that does the actual updating...
[Code]....
The function that the button calls to get the query... ERROR
We have a Page Method on a web page using ASP .Net. We tried to put in a trace statement using both System.Diagnostics and System.Diagnostics.Debug. In Visual Studio 2008, the break point is not even hit for the line, but other break points on other lines are hit.There is no output from either method that we can see.
There is also a Global.asax error catcher that works fine in other cases, but in the Page Method is not being catched.why a Page Method and System.Diagnostics do not play well together?
I have a few web applications that I maintain and I find myself very often writing the same block of code over and over again to bind a GridView to a data source. I'm trying to create a Generic method to handle data binding but I'm having trouble getting it to work with Repeaters and DataLists.
Here is the Generic method I have so far:
[code]....
That way I can just define my CommandText then make a call to "BindControls(myGridView, cmd)" instead of retyping this same basic block of code every time I need to bind a grid.
The problem is, this doesn't work with Repeaters or DataLists. Each of these controls inherit their respective "DataSource" and "DataBind" methods from different classes. Someone on another forum that I implement an interface, but I'm not sure how to make that work either.
The GridView, Datalist and Repeater get their respective "DataBind" methods from BaseDataBoundControl, BaseDataList, and Repeater classes. How would I go about creating a single interface to tie them all together? Or am I better off just using 3 overloads for this method?
public DataTable GetBrokers(bool? hasImport=null) { SqlCommand cmd = new SqlCommand("usp_GetBrokers"); if (hasImport.HasValue) cmd.Parameters.AddWithValue("@hasImport", hasImport); return FillDataTable(cmd, "brokers"); }
When the form loads I get this error:
ObjectDataSource 'srcBrokers' could not find a non-generic method 'GetBrokers' that has no parameters.
Is it my optional parameter that is causing the problem? How can I workaround this? Is it possible to have optional parameters with declarative ASP.NET code?
I am binding dropdown list using Object data source. I got an error like this
"ObjectDataSource 'objDSStatus' could not find a non-generic method 'GetIssueAllowedStatusByCategoryIDStatusIDandUserType' that has parameters: IssueCategoryID."
My code is as follows .aspx
< asp:DropDownList ID="ddlStatus" runat="server" DataSourceID="objDSStatus" DataTextField="IssueStatusName" DataValueField="IssueStatusID"> < /asp:DropDownList> < asp:ObjectDataSource ID="objDSStatus" runat="server" TypeName="DA"></asp:ObjectDataSource> .cs private void Bind(int IssueCategoryID, int IssueStatusID, int UserType) { ddlStatus.Items.Clear(); objDSStatus.SelectMethod = "GetIssueAllowedStatusByCategoryIDStatusIDandUserType"; objDSStatus.SelectParameters.Clear(); objDSStatus.SelectParameters.Add("IssueCategoryID", IssueCategoryID.ToString()); objDSStatus.SelectParameters.Add("IssueStatusID", IssueStatusID.ToString()); objDSStatus.SelectParameters.Add("UserType", UserType.ToString()); objDSStatus.DataBind(); ddlStatus.DataBind(); } DA.cs public List<IssueStatus> GetIssueAllowedStatusByCategoryIDStatusIDandUserType(int IssueeCategoryID, int IssueStatusID, int UserType) { List<IssueStatus> issueStatusList = new List<IssueStatus>(); }
I'm a starting C# programmer and I'm experiencing the following problem.I've created a dataset in Visual Studio With a table for persons making use of two table adapters, one for selecting all persons and one for selecting one person at a time filtered by the personID (Guid). This is a seperate project of my solution. After that I created a new project for the Business Logic Layer
private PersonenTableAdapter personenAdapter = null; protected PersonenTableAdapter Adapter {get....} [System.ComponentModel.DataObjectMethodAttribute (System.ComponentModel.DataObjectMethodType.Select, true)] public DAL.Testdatabase.PersonenDataTable GetPersonen() {...} [System.ComponentModel.DataObjectMethodAttribute (System.ComponentModel.DataObjectMethodType.Select, false)] public DAL.Testdatabase.PersonenDataTable GetPersonenByID(Guid ID) {...} [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)] public bool updatePersoon(string Voornaam, string Achternaam, string Geslacht, string Adres, string Huisnr, string Postcode, string Plaats, string Telnr, string GSM, string BSN, DateTime? CreateDate, string CreatedBy, DateTime? LastModifiedDate, string LastModifiedBy, bool? Actief, DateTime? DatumInactief, Guid ID) {...} When issueing the Update method using a detailsview with an Objectdatasource i get the following error. ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'updatePersoon' that has parameters: Voornaam, Achternaam, Geslacht, Adres, HuisNr, Postcode, Plaats, Telnr, GSM, BSN, CreateDate, CreatedBy, LastModifiedDate, LastModifiedBy, Actief, DatumInactief, original_ID.
The problem is when I use Guid UserId = Guid.NewGuid ();.
In Table I UserId type: unique Therefore it does not work. If I use the UserId type: int working.
Error: ObjectDataSource 'ProductsOptimisticConcurrencyDataSource' could not find a non-generic method 'DeleteProduct' that has parameters: ID, UserId.
Description: An unhandled exception occurred during the execution of the current web request. review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: ObjectDataSource 'ProductsOptimisticConcurrencyDataSource' could not find a non-generic method 'DeleteProduct' that has parameters: ID, UserId.
In one of the methods I'm using in my MVC app, there's a param that accepts a list collection of strings. If I have a string parameter, I can give it a default value of an empty string, but I cannot seem to give the list collection a default value of a new, empty list collection. I get the error that's beginning to seriously grate on my nerves about requiring a compile-time constant. getting the generic list to work with a default empty set?
I was building an application for a project with .NET 3.5 and I noticed a weird behaviour of the List.Add method:
I have built my own class to organize data pulled from a database, and I use a while cycle to iterate through it.
However, when I List.Add(item), the whole content of the list is substituted with the last content pulled.
An example:
Suppose you have 3 users in a DB, each one identified with an ID and a username:
| ID | username | | 1 | John | | 2 | Fred | | 3 | Paul |
and you have a "Users" class defined as
public class Users { private Int32 iD; private String username; public Int32 ID { get { return iD; } set { iD = value; } } public String Username { get { return username; } set { username = value; } } }
So you write this function:
[... SQL definitions - sdr is a SqlDataReader ...] List<Users> userlist = new List<Users>(); if (sdr.HasRows) //There are users { Users user = new Users(); while (sdr.Read()) { user.ID = sdr.GetInt32(0); user.username = sdr.GetString(1); userlist.Add(user); } }
What you expect (I expect) is userlist containing:
| ID | username | | 1 | John | | 2 | Fred | | 3 | Paul |
What I actually get is, instead
| ID | username | | 3 | Paul | | 3 | Paul | | 3 | Paul |
Cannot implicitly convert type 'System.Collections.Generic.IEnumerable' to 'hcgames.ObjectClasses.ShoppingCart.ShoppingCartCartAddon'. An explicit conversion exists (are you missing a cast?)
From this query
ShoppingCartItems items = Cart.GetAllItems(); ShoppingCartCartAddons addons = Cart.GetAllAddons(); var stuff = from x in items select new ShoppingCartItem() { ProductID = x.ProductID, Quantity = x.Quantity, Name = x.Name, Price = x.Price, Weight = x.Weight, Addons = (from y in addons where y.ShoppingCartItemID == x.ID select y) };
I am getting error : ObjectDataSource 'ObjectDataSource1' could not find a non-generic method What would be the possible cause / solution for this error.This error is coming when call below method ObjectDataSource1.SelectMethod = "MethodName"// thr r some more code after that, although not much irrelevant en call Server.Transfer("NewPage.aspx", True);
I added the extender and when i tried to add the method this message poped up; Cannot create page method "GetCompletionList" because no Code Behind or codefile was found.