Converting the Silverlight Business Application Template to use Windows Authentication

For my first “real” attempt at creating a business application using Silverlight I decided to use WCF RIA Services, Silverlight 4.0, and Visual Studio.NET 2010.  What easier way to get started than through a template provided by VS.NET 2010, right?  Well, in its effort to make it easier it also create some headaches.  Sometimes abstraction can add a learning curve as well.  In this case it created some headache for me on this project.  As an IT consultant for small to enterprise level business most of the usage of Silverlight will be in an Intranet zone and require Windows Integrated security where authentication and even authorization is centrally managed in Active Directory. 

The Business Application Template generates XAML, services, and other code to support Forms Authentication and an Extranet scenario out-of-the-box.  This is all great, but I now need to convert it to Windows Authentication.  I ventured down what I thought was a simple path by following directions included as comments in the generated code.  I made the switch in the App.xaml.cs file as depicted below. 

   1: public App()
   2: {
   3:     InitializeComponent();
   4:  
   5:     // Create a WebContext and add it to the ApplicationLifetimeObjects
   6:     // collection.  This will then be available as WebContext.Current.
   7:     WebContext webContext = new WebContext();
   8:     //webContext.Authentication = new FormsAuthentication();
   9:     webContext.Authentication = new WindowsAuthentication();
  10:     this.ApplicationLifetimeObjects.Add(webContext);
  11: }

I changed the web.config file to have it use Windows authentication and I removed the Profile section.

   1: <authentication mode="Windows">
   2:   <!--<forms name=".BusinessApplication1_ASPXAUTH" />-->
   3: </authentication>

I ripped out all of the Login and Membership related XAML.  Once I did all of this and start navigating and customizing the app I get a big fat error.  WHAT?

image

InvalidDataContractException, A profile property does not exist for FriendlyName.  I just removed all of the profile information why is this coming up?  After doing some digging the implementation of AuthenticationBase<T> will iterate through each property in the User class unless there is a certain attribute property setting and try and pull it from the ASP.NET profile database using the membership provider.  Here is what I found as part of the description when looking at it through RedGate Reflector,

By default, this domain service relies on the ASP.NET providers for Membership, Roles, and Profile and will reflect the customizations made in each.

Hmm, so how do I keep it from attempting to query the non-existent Profile.  If you look at the code in the User class (see below).  You will notice that it describes how to add a property that can be part of the profile, but it does not tell you how to keep it from being a part of it.  Okay, so now what?  I guess that means more digging.  After looking through the Book Club demo from Nikhil Kothari I discovered it.

/// <summary>
/// Class containing information about the authenticated user.
/// </summary>
public partial class User : UserBase
{
    //// NOTE: Profile properties can be added for use in Silverlight application.
    //// To enable profiles, edit the appropriate section of web.config file.
    ////
    //// public string MyProfileProperty { get; set; }
 
    /// <summary>
    /// Gets and sets the friendly name of the user.
    /// </summary>        
    public string FriendlyName { get; set; }
 
}

Here is how you do it.  You have to add the ProfileUsage attribute on your property with the IsExcluded property set to true.  I discovered this by looking at a demo from.

[ProfileUsage(IsExcluded = true)]

Details can be found on MSDN for its usage.  Here is a quote from the MSDN documentation.

This attribute is used by the AuthenticationBase<T> to determine how it should read from or write to the ASP.NET profile that backs the data. If a property with the same name exists in the profile, you do not need to use this attribute. If a property is not in the profile, you should set the IsExcluded property to true. If a property has a different name than the profile value that backs it, you should set the Alias property to the name of the backing value in the profile. The attribute can be used with user entities extending UserBase.

After applying the attribute, then you are ready to go.  If you want to adding properties to the User class and want to set properties, the best place that I could find is in the AuthenticationService implementation and in an override of the GetAuthenticatedUser() method.

protected override User GetAuthenticatedUser(System.Security.Principal.IPrincipal principal)
{
    User currentUser = base.GetAuthenticatedUser(principal);
 
    //TODO: Add your logic to collect data and set properties on the User class.
 
    return currentUser;
}

Hopefully this will aid you in your efforts of learning RIA services and SilverLight.  Good luck!

Technorati Tags: ,,,

Commerce Server 2009 Order Server Deserialization Error

During the deployment testing of an integration component with Commerce Server 2009’s Order Service I encountered the following error at a client site "Column requires a valid DataType."  It was occuring right at the point when deserializing the dataset from the GetPurchaseOrderAsDataSet() call.  We did not encounter this problem at all on any of the workstations.  The call stack was essentially of no help.  After some usage of FileMon and a few other diagnostics tools it struck me that maybe there was some crazy framework reflection work going on behind the scenes and it was attempting to load a soft dependency during the deserialization.  After thinking about it, I realized that it must depend on some of the Commerce Server types.  I installed the Order Management client tool that comes with Commerce Server and it all went away.  The client was fine with installing this on the production integration server so we left it at that.  I am sure that you could find a way to minimize what is necessary for deployment, but this is how we decided to quickly resolve the issue.  Voila, we’re all fixed!

Getting a List of a User’s SharePoint Groups

I found it very odd that this was not available when doing some search engine queries.  My requirement was to take in an AD user name and query SharePoint 2010 to determine the SharePoint groups in which the account belongs.  The code was to run from within a RIA Authentication Service, which is code run on a server and is not likely on the SharePoint server.  This code will also work with SharePoint 2007 (WSS 3.0 and MOSS 2007).  You will need to add a Web Reference to http(s)://<spservername>/_vti_bin/usergroup.asmx and name it SharePointUserGroupService.  Voila, you have your list of SharePoint groups for a user.  Maybe in the next version of the SharePoint Client Object Models (SCOM) this will be included.  It does required LINQ support (.NET 3.5 or greater) where this code is run (not necessarily on the server).

   1: private string[] GetRoles(string userName)
   2: {
   3:     UserGroup userGroupService = new UserGroup();
   4:     userGroupService.UseDefaultCredentials = true;
   5:     XmlNode xNode = userGroupService.GetGroupCollectionFromUser(userName);
   6:  
   7:     XElement groupXml = XElement.Parse(xNode.OuterXml);
   8:  
   9:     XNamespace ns = groupXml.Name.Namespace;
  10:  
  11:     var item = from xml in groupXml.Elements(ns + "Groups").Elements(ns + "Group")
  12:                let GroupName = (string)xml.Attribute("Name")
  13:                select GroupName; 
  14:  
  15:     return item.ToArray();
  16:  
  17: }

SharePoint Planning/Design Worksheet Links

I ran across a blog entry with a consolidated list of links to the SharePoint 2007 planning worksheets.  These are good starting points for your discovery, analysis, and design and are provided by Microsoft.  I would suggest tweaking them to meet your organizational needs.  http://itfootprint.wordpress.com/2007/10/05/sharepoint-planning-worksheets-in-one-place/

TechNet provides a consolidated list of planning worksheets for SharePoint 2010.  http://technet.microsoft.com/en-us/library/cc262451.aspx 

Technorati Tags: ,,

SharePoint Excel Services 2007 is Exciting, HUH?

Over the past three plus years that I have been working with SharePoint, I have never had the pleasure of giving an Excel Services presentation to a client.  Well, thanks to our awesome sales team this past week I was able to do that very thing.  I have been a part of some Excel Services implementations, but they were really focused on trying to create a “poor man’s” business intelligence solution with use Excel Services and Excel on top of an Analysis Services OLAP.  Of course, this was prior to the announcement of rolling in Performance Point to SharePoint Enterprise.  My experiences with using Excel Services as a BI solution somewhat skewed my opinion of the product towards the negative.  After this experience, I can say that I am really beginning to understand more of the benefit of the current and the future MS Office Services offerings.  The looks on the faces of the ten business users from various groups were priceless.  A lot of them just stared in awe and when they started asking question, they almost didn’t want to stop.  This almost reminded me of the reason that I got into this business, to get a rush from seeing the customer satisfied and praising you as if I had performed some sort of a miracle.  It was a great feeling.

I gathered a bit of information through emails with the client’s business units and prepared for my presentation.  There was not much out of the ordinary.  The two business units were both working directly with spreadsheets, compiling data for periodic reporting and sending them around through emails.  There was mention of pulling data from several of their internal systems and present them in pivot tables and charts.  It sounded like there were many different target audiences of this data.  I was able to dig up an old slide deck from the Microsoft Office team.  Here is what it has listed as the benefits:

  • Incorporate spreadsheets in portals and dashboards
  • Eliminate “multiple versions of the truth” caused by distributing copies of spreadsheets
  • Control access to spreadsheets for regulatory concerns or to protect proprietary information
  • Leverage servers to offload long-running calculations from desktop machines
  • Reuse logic & business models built in Excel in applications written in other languages without having to re-code the logic/business models

It turns out that each one of these is applicable to this client’s situation.  As we dove deeper into their current usages of Excel, I was able to uncover that they have formulas in spreadsheets that are passed around from spreadsheet to spreadsheet.  It was also discovered that they are dealing with stale data quite often and feel the pains of doing so.  What really made them excited was the ability to create dashboards allowing them to create different perspective levels of their data.  I was able to review some of their spreadsheets and determined they could easily be presented to their target executive and senior management audiences in meaningful perspectives.  What happens today is that they send these big spreadsheets to this audience and they end up just asking the business unit for the information anyway.  They get information overload having too many details and it just makes the business unit do double the work.  Another exciting feature for them was the ability to pass parameters from SharePoint to a named area.  There is a rate quote spreadsheet that they use today that would be a great fit for this feature.  They could expose it to their users from Excel Services through a web part page or just a link to the viewer. 

Other good things may come out of the conversations during the presentation, such as IT working with the business unit to allow for more real-time data integration.  In one case the business unit was taking a CSV generated by a nightly SSRS report, converting it into an Excel file, and creating pivot tables off of the data.  IT mentioned that all of the logic for flattening out the data and performing the calculations was performed in the report.  They seemed more than willing to expose a stored procedure in which the business unit could use as a data source for a spreadsheet.  While this is a much better solution than what they have today, I stressed that it is the first step that they should be taking to move to a more business intelligent environment.  This does not mean that they need to create an OLAP, but it does mean that they need to aggregate their data from their mainframe and other operational systems into a reporting warehouse database(s).  This will allow the business users to have more flexibility in querying their data so as to have better insight into their business.

I will be following up with the client after my vacation to see how things are going, but I suspect that they will be reaping some benefits in the very near future.

Technorati Tags: ,

Baton Rouge .NET User Group Getting Some Press

After the second installment of our Speaker Idol format, I was asked by INETA to write an article for the January newsletter targeting other user group leaders.  It came out great.  The article describes the event format and some of our lessons learned.  You can view the article at http://ineta.org/newsletters/2010_01.htm#CommunityEventWrapup.  There is a lovely mug shot.  That serves me right for not having a more professional picture ready and had to get someone to take a picture in the office with their iPhone.  Thanks to Jay Smith for suggesting the article idea to INETA.

Recently we had a large technology service provider, IEM, announce that it was moving its headquarters from Baton Rouge to North Carolina.  You can read about the articles from the Greater Baton Rouge Business Report:

http://www.businessreport.com/news/2009/dec/28/cost-losing-iem/
http://www.businessreport.com/news/2009/dec/28/goin-carolina-edvl1/

In response to a lot of the negative press about Baton Rouge I submitted an article suggestion to the Baton Rouge Business Report, which can be seen at http://www.businessreport.com/news/2010/jan/11/letters-gnit1/.  I was contacted a few weeks later by one of their writers, David Jacobs, who interviewed several of us including yours truly, Jon Dalberg, Patrick Leblanc, and William Assaf.  He and their photographer came to one of our combined meetings (1st time ever) with the SQL Server User Group at Lamar Advertising.  It was a great turnout and David obviously got a lot out of it.  You can view some of the pictures from our meeting with Ted Neward on our Facebook page:

The article was published this week with a nice picture of me “raising the roof.”  You can read it at http://www.businessreport.com/news/2010/jan/25/networking-it-tchn1/.  Thanks to all that make our user groups and events happen!  We’ll keep pushing to make this community better!  Every little bit helps. 

SharePoint 2010 PnP Guidance Drop 2 Released

On Monday the PnP team released the 2nd drop of the SharePoint 2010 Guidance.  Included is an example of a sandboxed solution, which is a good list aggregation scenario related to SOW’s (statements of work) and estimates across a number of sub-sites.  I am VERY excited about the work that is being done and guidance documentation and code that will be released soon.  You will also begin to see tests utilizing Moles for “detouring” or “mocking” as well as examples of tests using several different unit testing different frameworks including Pex.  For more details refer to http://research.microsoft.com/en-us/projects/pex/pexsharepoint.pdf.  There are now other options than just TypeMock. 

SharePoint 2010 PnP Guidance Drop 1 Released

On Friday the Patterns and Practices team released the first drop of the SharePoint 2010 Guidance, http://spg.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=38461.  It includes the upgrades for service locator, config manager, and logger.  There is some great guidance for the new Sandbox feature of 2010 in the upcoming release.  Stay tuned!

SharePoint PnP Advisory Team

I am elated to announce that I have been asked to participate on the advisory team for the next release of the SharePoint Guidance by the MS Patterns and Practices team.  The upcoming release is focused on guidances around SharePoint 2010.  I have already attended one meeting and read through the first few drops of the guidance and am VERY excited about what I see so far.  There will be some great information around the selection of the scope of features and determining when to use the sandbox.  It will be great to have this released when SharePoint 2010 goes live.  If you have not read through the current guidance or looked through the current code deliverables, make it a point to do so, http://codeplex.com/spg.  The latest drop has some excellent information that I would have loved to have had a year ago!  I will try and post some details in the future regarding this guidance. 

PDC 2009 Hangover

For the first time in my career I have attended a major conference and it was well worth the wait.  I had a handful of major objectives in attending of which all were met.

  1. Gain an understanding of Azure and how we can leverage it for our small and mid market customers.
  2. Gain more detailed insight into changes in SharePoint 2010 that will impact customizations and solutions that we provide our customers.
  3. Have some dialog with some of the MS data team members and others to understand MS’ vision for data store interaction.
  4. Meet people and make some great contacts.

There are a few things that became VERY clear as early as the first day.

MS’ Vision is “clouded.”  (***pun intended***)

Microsoft has made major investments in software (across a large portion of product lines), hardware, and relationships in order to make their vision of 3 screens and a cloud a reality.  They now have a modular datacenter in which they will be reselling at some point in the future.  You can see an installation at http://www.microsoft.com/video/en/us/details/bafe5c0f-8651-4609-8c71-24c733ce628b.  It is essentially a data center in a box that can be delivered like a POD storage unit.  It can be “plugged” into your existing datacenter or it can be standalone.  In either case Windows Azure is the operating system for the data center.  It has services that facilitates many features, but an example is support for quick scale out of servers.  This is controlled by a customer developer portal that only takes a few configuration changes in the browser and clicking a button to increase the number of servers.  Silverlight is being highlighted as part of this vision as it enriches the browser experience and will soon find its way to a mobile device.

There is a Focus on OS Usability with Win 7

Microsoft has gone back to the basics and spent much time and effort in improving the usability of their consumer operating system.  They want Windows 7 to be successful so much that they gave us each a laptop loaded with the Ultimate edition that supports all features including the multi-touch display.  They spent a decent chunk of time on this during the second day keynote.

There is a Push for SharePoint Adoption by Developers

The development environment for SharePoint customizations is now a first class citizen in Visual Studio and SharePoint.  While there seem to be a few kinks to work out between now and the release of MSS 2010 and VS 2010, it is VERY exciting.  It was unfortunate to see that a good portion of developers left the keynote when they started talking about Office and SharePoint 2010.  For every session block there seemed to be a session on something SharePoint related.

The Data team (as they are now called) has heard our pain of getting something drastically new annually

In listening to the keynote and several sessions as well as speaking with Elisa Flasko from the data team it became evident that one of the main reasons for them introducing oData was to make things more consistent and transparent.  This will allow us to have one consistent API/Protocol to use instead of having to choose from between ADO.NET Data Services, REST Services, etc.  I was pretty impressed with what I saw.  Check out the new data site on MSDN, http://msdn.microsoft.com/en-us/data/default.aspx

Thanks again to Chris Koenig, MS Developer Evangelist, for letting a newbie hang around!

LINQ-to-SQL Challenge of the Day – WHERE IN “ALL”

Today I took on the challenge of improving the performance of a set of repository retrieval methods that have been a bottleneck for our system for the past week.  Here were the requirements and details for the most challenging method:

  1. There is a Clinic and a Service table with a joining table for the many-to-many relationship, ClinicService.  A clinic provides one to many services and a service can be provided by one to many clinics.
  2. The method accepts in a list of primary key integer values for the Service table.
  3. The method must return back the list of clinics that provide ALL of the services.

At first glance this would seem like a basic SQL query.  After looking at the details, I quickly learned that the challenge was to ensure that for a clinic to be returned it must have a relationship with all of the provided clinics.  At first I made the mistake of skipping this little detail and came up with a basic query with a join and an “IN” statement generating the following SQL:

SELECT DISTINCT [t0].[ID], [t0].[Name], ...
FROM [dbo].[Clinic] AS [t0]
INNER JOIN [dbo].[ClinicServices] AS [t1] ON [t0].[ID] = [t1].[ClinicID]
WHERE [t1].[ServiceID] IN (5, 27, 36, 57, 66, 68)

The LINQ-to-SQL statement needed to generate the “IN” clause was a little bit of a challenge for me because it was a different mindset.  After some assistance from our my fellow bloggers, I realized that I was thinking about it backwards.  The LINQ statement is a reversal of the TSQL syntax.  Using the Contains extension method of my List of key values, I was able to generate the “WHERE [t1].[ServiceID] IN (5, 27, 36, 57, 66, 68)” statement.  Here is the winning LINQ clause: 

where serviceIds.Contains(cs.ServiceID) 

After testing this out, I realized that this would result in a larger set than desired because it would return a clinic if it provided just one of the services.  I needed to ensure that the clinic provides all services.  OOPS.  After brainstorming with our “creative” DBA, he came up with a quality TSQL statement that I would just need to reverse engineer and construct a LINQ statement.  Yippie, please don’t try that one at home.  This was a real challenge especially since his solution contained basically all parts of a standard SQL query.

SELECT [t0].[ID], t0.name
FROM [dbo].[Clinic] AS [t0]
INNER JOIN [dbo].[ClinicServices] AS [t1] ON [t0].[ID] = [t1].[ClinicID]
WHERE [t1].[ServiceID] IN (5, 27, 36, 57, 66, 68)
GROUP BY [t0].[ID], t0.Name
HAVING COUNT(1) = 6

WOW, so now I need to have a join, where clause, group by, a having clause, and a count.  So much for being a newbie with LINQ to SQL.  After spending a bit of time getting confused as heck trying to understand how to have both a group by and having clauses generated, I went the route of a sub query.  Here is what I came up with that worked great and was DBA approved.

var result = (from c in db.Clinics
where (from subc in db.Clinics
join cs in db.ClinicServices on subc.ID equals cs.ClinicID
where serviceIdFilter.Contains(cs.ServiceID) && subc.ID == c.ID
&& subc.IsActive && cs.IsActive
select 1).Count() == serviceIdFilter.Count
select c);

Thanks to the handy LINQPad tool, I was able to test out my statement and send the TSQL that it generated to my DBA for his stamp of approval.  Here is what it generated:
-- Region Parameters
DECLARE @p0 Int = 5
DECLARE @p1 Int = 27
DECLARE @p2 Int = 36
DECLARE @p3 Int = 57
DECLARE @p4 Int = 66
DECLARE @p5 Int = 68
DECLARE @p6 Int = 6
-- EndRegion
SELECT [t0].[ID], [t0].[Name], [t0].[PhysicalAddress1], [t0].[PhysicalAddress2], [t0].[PhysicalCity], [t0].[PhysicalState], [t0].[PhysicalZip], [t0].[MailingAddress1], [t0].[MailingAddress2], [t0].[MailingCity], [t0].[MailingState], [t0].[MailingZip], [t0].[HoursofOperation], [t0].[PrimaryContactName], [t0].[Phone], [t0].[Fax], [t0].[Email], [t0].[Description], [t0].[Notes], [t0].[IsActive], [t0].[Version], [t0].[CreatedDate], [t0].[CreatedBy], [t0].[UpdatedDate], [t0].[UpdatedBy]
FROM [Clinic] AS [t0]
WHERE ((
SELECT COUNT(*)
FROM [Clinic] AS [t1]
INNER JOIN [ClinicServices] AS [t2] ON [t1].[ID] = [t2].[ClinicID]
WHERE ([t2].[ServiceID] IN (@p0, @p1, @p2, @p3, @p4, @p5)) AND ([t1].[ID] = [t0].[ID])
)) = @p6

Technorati Tags: ,

Be back after this short break...

I've been working a LOT lately trying to get a release out for a client.  I will be back in the next couple of days with my feedback on Houston Techfest, a blog on an application of Open XML SDK 2.0, and more...

Quick Update & Upcoming Events

I’ll be very busy over the coming weeks wrapping up a big project for a client so I won’t have much time to write.  Here is a brief update on happenings. 

This week I was able to purchase my PDC 2009 ticket.  I am very much looking forward to this event as there are a LOT of exciting topics with the upcoming releases, Office 2010, VSTS 2010, and .NET 4.0.  I’ll be pretty busy after this event doing presentations at work, for clients, and a few user groups in the area after learning more at the PDC.

Next weekend is Houston TechFest, which I am looking forward to as well.  Unfortunately, I have not had a lot of time to look at the sessions to determine which I will attend.  On Friday night I’ll be attending a dinner for user group leaders in the South Central Region hosted by Microsoft.  It will be nice to meet a few of the leaders in the bigger markets such as Houston, Dallas, and San Antonio.  We have been working pretty hard to improve the Baton Rouge .NET user group and promoting technology events in our area.  Thanks to Zain Naboulsi with MS for coordinating the dinner and helping us collaborate and improve!

Another event in which I am looking forward to is the upcoming SharePoint Saturday event in Birmingham, which I am hopefully going to be able to attend.  They are still working on sponsors and speakers.  If you are interested, go sign up.  Barry Ralston is one of the speakers and is very involved in the event.  He was a speaker at our SQL Saturday event and did a great presentation on BI Solutions for a Tough Economy.

We are already planning for SQL Saturday #28 in Baton Rouge on August 14, 2010.  This year Mark is getting us both sides of the building so that we can have around six concurrent sessions.  This will also spread us out giving us more room to handle more attendees and sponsor booths.  We’re compiling all of the feedback, gathering information from other events, asking for advice from larger event organizers, and working on more national sponsors so that our 2010 event will be even bigger and better.  After getting the first one under our belt and working out the kinks, the next one should go even smoother.  Of course, we have twelve months to plan this year whereas last year we only had four. 

Below is a list of upcoming events that I will be attending and that others in the south Louisiana area may be interested in attending.  Let me know if I missed any.

9/23/2009 Baton Rouge .NET User Group 5:30 - WCF
  Acadiana .NET User Group 5:30 - WCF
9/26/2009 Houston Tech Fest – All day
10/8/2009 New Orleans .NET User Group TBD
10/21/2009 Baton Rouge .NET User Group – Inversion of Control, Dependency Injection, and other Goodness
10/29/2009 Acadiana .NET User Group - Introduction to Windows Azure
11/17 – 11/19 Los Angeles - Microsoft PDC
11/18/2009 Baton Rouge .NET User Group – Fluent NHibernate
11/21/2009 Birmingham - SharePoint Saturday
12/16/2009 Baton Rouge .NET User Group - Speaker Idol (2nd Edition)

 

Every two weeks there will be a SQL Lunch virtual event.  There are lots of great topics and a good opportunity for presenting on a short topic.  For more details see the calendar.

Technorati Tags:

Wrapper for the SharePoint List Service

It has been a long time coming and I was finally able to find a diamond in the rough by locating a wrapper for the “challenging” yet powerful Lists.asmx service provided by WSS 3.0.  On my current project we had the need to interact with WSS to pull back some document templates that reside in a document library.  It only made sense for the implementation of this repository to use Lists.asmx or interact with a custom service that uses the SharePoint object model.  I figured by now someone had created a simplified way to interact with Lists.asmx without having to deal with all of the complexities of the XML.  After using multiple search engines, I found a comment in a Blog that subtly mentioned the solution.  Hidden away at the very end of an article on MSDN, http://msdn.microsoft.com/en-us/library/dd365137.aspx, there is mention of SharePointUtility.dll.  This assembly includes the static wrapper class.  It is part of a great project on CodePlex that focuses on SSIS extensions, http://www.codeplex.com/SQLSrvIntegrationSrv.  A co-worker actually just used this today to move data from one column in a list to another and it worked like a charm.

The assembly can be downloaded as a separate download or you can get the source from the source control tab on http://www.codeplex.com/SQLSrvIntegrationSrv. While we are currently only using this for development, so far so good.   Here is a sample of its usage of getting data from a document library:

[WebPermission(SecurityAction.Assert)]
public List<ServicePaperworkTemplate> FindForServices(List<Service> services)
{
List<ServicePaperworkTemplate> results = null;
List<Dictionary<string, string>> resultFromSharePoint = null;
string queryString = default(string);
XElement query;

//These are the fields that we want in the result set.
string[] resultFields = new string[]
{
Fields.ID,
Fields.DateCreated,
Fields.DateUpdated,
Fields.DocumentEncodedAbsoluteUrl,
Fields.DocumentTitle,
Fields.DocumentVersion,
Fields.UserCreated,
Fields.UserUpdated,
Fields.ServicePaperworkTemplatePageCount,
Fields.ServicePaperworkTemplateServiceAbbreviation
};

queryString = _buildCamlQueryForFilteringByServiceAbbreviation(services);
query = XElement.Parse(queryString);

//Query SharePoint for the list items based on the CAML query string.
resultFromSharePoint = ListServiceUtility.GetListItemData(SharePointSiteUrl, Lists.ServicePaperworkTemplates,
resultFields, query, true, 10) as List<Dictionary<string, string>>;

//Translate from the results to the list of business entities.
results = EntityFactory.Create(resultFromSharePoint, false) as List<ServicePaperworkTemplate>;

//Fill in the documents.
_populateTemplateDocuments(results);

return results;
}

Technorati Tags: ,,

SQL Lunch Live Meetings

The Baton Rouge Area SQL Server User Group has started up a technology live meeting during lunch time.  Please see Patrick Leblanc’s blog for more details in participating both as a presenter and as a participate.  This is available from anywhere and is not restricted to Louisiana.  Also, even though it has “SQL” in the name the topics can veer off of SQL Server topics such as a topic on .NET development.  This is a great avenue to test out your presentation skills since it is a short live meeting event.  This link will direct you to how you can signup to receive notifications.

http://www.sqlservercentral.com/blogs/sqldownsouth/archive/2009/08/05/call-for-speakers-sql-lunch-live-meeting.aspx

«September»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789