AWG Blogs

Tuesday, August 24, 2010

Sharepoint 2010 ASP.NET Impersonation

I was getting

"Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'

when attempting to access my list linked to an external content type, a remote SQL Server Database.

To resolve the issue, I opened IIS 7 \ Sites \ SharePoint - 80 \ Authentication \ ASP.NET Impersonation \ edit, then added a domain account here that could access the SQL Server.

I'm sure this might not be the best practice, security-wise, but hey, at least now it works!

Oh, to even get as far as the above login failed error, I had to do:

Central Administration \ Manage service applications \ Business Data Connectivity Service \ [my external content type] \ Set Object Permissions, then add the above domain account.

---
Update:

Trying on another machine in a different domain now and got: "access denied by business data connectivity"
when trying to add a connection to the External Content Types.
Solved by going to Central Administration \ Manage service applications \ Business Data Connectivity Service \ Set Metadata Store Permissions, and adding my domain account with all available permissions.

ORM LINQ Style

I'm rediscovering LINQ, and came across this article - http://weblogs.asp.net/scottgu/archive/2007/05/19/using-linq-to-sql-part-1.aspx - by Scott Guthrie (probably not the first time I've read this article).

Ever wonder why arrows seem to point in the opposite direction in E-R diagrams? This paragraph explains it. It ties in well with O/RM, in that the mapped objects will be composed of their children. I always tended to look at it in the direction of the diamond head as more intuitive speaking of foreign keys and all.

The arrows between the four entity classes above represent associations/relationships between the different entities. These are typically modeled using primary-key/foreign-key relationships in the database. The direction of the arrows on the design-surface indicate whether the association is a one-to-one or one-to-many relationship. Strongly-typed properties will be added to the entity classes based on this. For example, the Category class above has a one-to-many relationship with the Product class. This means it will have a "Categories" property which is a collection of Product objects within that category. The Product class then has a "Category" property that points to a Category class instance that represents the Category to which the Product belongs.

Sunday, August 8, 2010

I Discover DCI

I just now discovered DCI; see http://www.artima.com/articles/dci_vision.html

All I can say is, it's about freakin' time! For too long we programmers have struggled with staying true to OO, but faltering because as a model OO does not provide an adequate place to store algorithms. That's why of late, I have been putting the algorithms in stored procedures. Hey maybe that's a DCI best practice! Too early to tell. Hopefully a language comes out that supports DCI.

BTW, is Trygve Reenskaug a god or what?