DataSource Controls :: Error - Cannot Load Linq-sql Data Context Type
Mar 13, 2010Cannot load linq-sql Data Context Type Error
[Code]....
Cannot load linq-sql Data Context Type Error
[Code]....
I'm trying to add a LINQ datasource to my ListView control but it doesn't pick up the data context that I created. All it shows as options in the dropdown list are AJAX objects. What could be the possible causes for this?
View 3 RepliesI have a requirement where i need to combine tables from two different datacontext. Does Cross context is allowed in Linq??
i wrote a linq query but its throwing error.
I have the following:
[code]....
I keep getting this error:
Message = "The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value."
What i'm trying to do is group by ContentObjectId and then get StartDate that is greater than today.
I'm using entity framwork and MS SQL2008
I have an Interface that has its concrete class defined via a factory. Because of this I found no way to use the Interface tpye directly in my LINQ quesry so I had to use the concrete class types to creat a generic list. The LINQ query works but after calling.ToList() on the LINQ query result I get a List(of MyConcreteClass), but I need a List(of IMyConcreteClass). I have tried everything I can find: .Cast, Ctype, implicit casting, etc. but I always get back one of the (2) messages (depending on if I attempt to cast)message:
"Unable to cast object of type 'System.Collections.Generic.List`1[MyConcreteClass]' to type 'System.Collections.Generic.IEnumerable`1[IMyConcreteClass]'."
...or
"Unable to cast object of type '<CastIterator>d__aa`1[IMyConcreteClass]' to type 'System.Collections.Generic.List`1[MyConcreteClass]'."
Here is the sample code:
[Code]....
I wanted to delete the record from data but I receive this error "Unable to cast object of type 'System.Data.Linq.DataQuery`1[training_eval.Course]' to type 'training_eval.Course'.
Dim eval_sure = From ev In db.Evaluates Where ev.course_id = indexcourse Select ev.course_id
Dim del_course = From c In db.Courses Where c.Course_id = indexcourse
db.Courses.DeleteOnSubmit(del_course)
db.SubmitChanges()
I have a strange problem. I am adding a LinqDatasource object, and set the context:
[Code]....
Then I get this error:The type 'System.Data.Linq.DataContext' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.
On web.config I already have this:
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
NOTE: The datacontext is in a different project (DLL proect) where I added a refernce to System.Data.Linq.
is there another way adding a refernce to a web project? or only though teh web.config?
when i am trying to uedit my recods in gridview this error is coming. I am using SQLDatasource with gridview and for edit purpose i am using stored procedure. I have manually executed the SP and its woring fine. my SP is here
[Code]....
and my SQLDataSource is here
[Code]....
and gridview is here
[Code]....
i am trying to retrieve data from sql database but I get this error: < An expression of non-boolean type specified in a context where a condition is expected, near ')'. > whats this error meaning?
View 10 RepliesI am trying to fill a gridview with the data from Product table selecting few columns . I am using 3 - tier architecture and in DAL getproduct(userid) I am writing the query but cannot figure out exactly how to get that working .. here is piece of method I wrote
public List<Project> GetProjectList(int ownerId)
the same problem wuit hme here I wanna to convert from IQureable<int> to int type?
View 2 RepliesI have a website having an aunthentication system. When I am setting my website on IIS 6 the code is absolutly working fine. But when i configure the website on IIS 7 (Windows 2008 server) it is showing me the above error. I am using a stored procedure for it
View 3 RepliesI am getting error "Cannot implicitly convert type 'string' to 'System.Data.DbType".
When I am passing Stored procedure parameter it expets 'System.Data.DbType" and the Data member is declared as a string.
I have a partial class extending my Entity Model. I'd like to write a method that returns a collection of types from my entity framework model. For example, I'd like to get all the states to populate a drop down list. So I've written a method called getallstates(), similar to the example below:
[Code]....
I tried returning a list of Objects, and a list of states to my calling method to be used to bind to a drop down list. However I get an error that:
Server Error in Application. Unable to cast object of type 'System.Data.Objects.ObjectQuery to type 'System.Collections.Generic.List`1[System.Object]'.
What should my return type be for this function?
I've added the Dynamic.cs file to my project and have set it's Build Action = Compile in order to get the System.Linq.Dynamic namespace.
However, when I try to use any of the new code I am getting an ambiguous call error; see below.
[Code]....
First of all im new to asp.net and am in the process of learning it.
Heres my problem, i am receiving this error when submitting the form: "Arithmetic overflow error converting numeric to data type numeric"
And it halts at command.ExecuteNonQuery();
Input form:
[Code]....
Code Behind:
[Code]....
Stored Procedure:
[Code]....
I have this error "The given value of type String from the data source cannot be converted to type datetime of the specified target column." when I used sqlbulkcopy to do the transaction
Here is my code:
[code]....
I have a gridview which I'm trying to get the display of phonenumbers listed in a certain display format; (xxx) xxx-xxxx.If I have the code such as this, it displays the unformatted phone number and (000) 000-0000 for the null items.
[Code]....
i have set the type of a column in a table numeric(6,2) but when i insert a value above 9999,99 i get the error
"Arithmetic overflow error converting numeric to data type numeric."
Do you know whats wrong??
ofc thats all through visual studio for an asp site thats why im posting here
I keep getting the above error whether I ran my asp.net solution from the IDE or publish it on IIS. I always Build before each one of these steps.
I have user controls inside web pages and have 4 different projects that each reside in its own folder.
I have a login page and main user page that are one project then the user on this main page can go to 4 different areas which are all separate projects in their own folders. Links on this page to these sections are as follows:
./MyYFolder/MyYMain.aspx
If user clicks they get the error. Bizarrely if I locate the page MyYMain.aspx in the root folder and change the path in that main page to:
./MyYMain.aspx
As a bright spark noted, my problem isn't that I'm getting no error under the 2nd scenario. My problem is that I'm getting an error under the 1st one.
If I have a linq query that creates the anonymous type below:
select new
{
lf.id,
lf.name
lf.desc,
plf.childId
};
Is it possible to assign a specific type to one of the members? Specifically I would like to make lf.id a null-able int rather than an int...
For some reason my DataContext is not showing all the normal methods like SubmitChanges() etc in the intellisense.It also won't compile if I type in db.SubmitChanges();Any idea what I'm doing wrong? Normally I don't have this issue, I have several other projects that work fine...
View 1 RepliesI just deployed a test MVC2 application to a shared host and get the error Could not load type 'System.Web.Mvc.UrlParameter' when firing up the application.This is a bin readable application as my hosting provider does not yet have MVC2 installed, however, they assure me this should run OK. Also this is a barebones application, basically the default project structure published for testing purposes.Any suggestions as to resolving this?
View 3 RepliesI'm a newb to ASP.NET and I made an app in VS2010 using NET 4.0 (Working all fine in debug mode)
I tried to host my app @ aspspider and I'm getting the following error:Parser ErrorDescription: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.Parser Error Message: Could not load type 'AuthStealerPanel._Default'.Source Error:
Line 1: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="AuthStealerPanel._Default" %>
I also tried to rebuild the .dll and upload it to the /bin/ and application's root.
I have built an application in ASP.NET 3.5 framework and it is working fine on localhost but when i am uploading it on my server the page gives an error on loading "Parser Error Message: Could not load type 'Default'." <%@ Page Language="C#" AutoEventWireup="true" Debug="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
View 2 Replies