.net - Error with EntityDataSourceExtention to Enable Insert(): "type or name EntityDataSource could not be found" -


in visual web developer 2010, i'm trying implement extension entitydatasource described on page enables insert() used method:

http://social.msdn.microsoft.com/forums/en-us/adodotnetentityframework/thread/d8a3ecd8-55dd-45ad-8175-d7ce912f46c2/

i compile error "cs0246: type or namespace name 'entitydatasource' not found (are missing using directive or assembly reference?)"

i created class provided on page: http://forums.asp.net/t/1621469.aspx/1

no difference between 2 (except 1st link's version gets vwd recognize entitydatasourceextentions class name - color codes in blue-green.) should using .net 4.0.

addition: these contents of class, saved entitydatasourceextentions.cs in app_code:

using system.collections.specialized;  namespace system.web.ui.webcontrols {     public static class entitydatasourceextentions     {         private static bool defaultoperationcallback(int affectedrows, exception ex)         {                 return false;         }         public static void insert(this entitydatasource datasource)         {                 (datasource idatasource).getview(string.empty).insert(new ordereddictionary(),defaultoperationcallback);         }     } } 

this content of web.config, since seems play role in adding different assemblies compile:

<?xml version="1.0" encoding="utf-8"?> <configuration>   <connectionstrings>     <add name="customconn" connectionstring="removed=true;" providername="system.data.sqlclient" />     <add name="customentities" connectionstring="removed=true;multipleactiveresultsets=true;app=entityframework&quot;" providername="system.data.entityclient" />     <add name="testconn" connectionstring="removed=true;multipleactiveresultsets=true;app=entityframework&quot;" providername="system.data.entityclient" />   </connectionstrings>   <system.web>     <compilation debug="true" targetframework="4.0">       <assemblies>         <add assembly="system.security, version=4.0.0.0, culture=neutral, publickeytoken=x1" />         <add assembly="system.data.entity, version=4.0.0.0, culture=neutral, publickeytoken=x2" />         <add assembly="system.data.entity.design, version=4.0.0.0, culture=neutral, publickeytoken=x3" />       </assemblies>       <buildproviders>         <add extension=".edmx" type="system.data.entity.design.aspnet.entitydesignerbuildprovider" />       </buildproviders>     </compilation>     <customerrors mode="off" />     <pages>       <controls>         <add tagprefix="custom" tagname="sidebarads" src="~/_user_controls/sidebarads.ascx" />         <add tagprefix="custom" tagname="comingsoon" src="~/_user_controls/comingsoon.ascx" />         <add tagprefix="custom" tagname="stateselect" src="~/_user_controls/stateselect.ascx" />       </controls>     </pages>   </system.web> </configuration> 

now i'm looking @ web.config... noted on few websites, there difference between "system.data.entity" , "system.web.entity". should there .web.entity assembly added make work? happen know tag?

apparently verbiage needed know "reference".

and menu deal in vwd website > add reference... followed .net tab.

gives me:

<add assembly="system.web.entity, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/> <add assembly="system.web.entity.design, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/> 

(and know, apparently publickeytoken not sort of sensitive data.

helpful info:

adding assembly reference within web.config

http://en.wikipedia.org/wiki/.net_assembly )

and, finally, added entitydatasourceextentions.cs file app_code folder, , rebuilt site, , don't compile error anymore. (funny should have add in reference assembly when i'm using datasource in page successfully. blessed if knew how working.) while still don't know if entitydatasource.insert() solve design problem, @ least got past initial, obnoxious compile error.


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -