A: The fabulous Scott Hanselman has the answer:
Zipping/Compressing ViewState in ASP.NET - Scott Hanselman:
He's actually referring to someone else's code here. The short answer is, you subclass System.Web.UI.Page and override the LoadPageStateFromPersistenceMedium() and SavePageStateToPersistenceMedium() methods.
'via Blog this'
Thursday, April 5, 2012
Tuesday, February 21, 2012
Q: How do I write to SharePoint lists using LINQ to SharePoint?
LINQ to SharePoint provides a terrific query facility, but it also makes it really easy to add and update list items.
From MSDN: How to: Write to Lists Using LINQ to SharePoint
The particularly interesting code snippet:
From MSDN: How to: Write to Lists Using LINQ to SharePoint
The particularly interesting code snippet:
// Create the new list item. TeamMember bob = new TeamMember() { Title="Bob Smith" }; // Set the item to be inserted. teamSite.TeamMembers.InsertOnSubmit(bob); // Write changes to the content database. teamSite.SubmitChanges();
Easy as that!
Labels:
.NET,
SharePoint,
SharePoint 2010
Thursday, November 3, 2011
Q: I have a SQL Server Reporting Services report that uses a stored proc with three output parameters. How do I use the values of the parameters in the report?
The problem that you're having is that SSRS doesn't actually support SP output parameters. You have to wrap your stored procedure with another stored procedure that puts the output parameter value into a rowset. Here's a simple example. If you want, you can just copy & paste into a query in SQL Server Management Studio and it will work:
/*** Begin Example ***/
-- Setup
CREATE TABLE customers
(
customerid INT IDENTITY,
firstname VARCHAR(50),
lastname VARCHAR(50),
custstatus VARCHAR(50)
)
GO
INSERT customers
VALUES ('John',
'Smith',
'Active')
GO
-- First Stored Procedure, which uses output parameters.
-- This cannot be used directly in SSRS
CREATE PROCEDURE dbo.Usp_proc1 @CustID INT = 0,
@p1 VARCHAR(50) OUTPUT,
@p2 VARCHAR(50) OUTPUT,
@p3 VARCHAR(50) OUTPUT
AS
SELECT @p1 = firstname,
@p2 = lastname,
@p3 = custstatus
FROM customers
WHERE customerid = @CustID
GO
-- Second Stored Procedure, which wraps the first one, converting
-- the output parameters into fields in a single-row rowset.
CREATE PROCEDURE dbo.Usp_proc2 @CustomerID INT = 0
AS
BEGIN
DECLARE @p1_output VARCHAR(50),
@p2_output VARCHAR(50),
@p3_output VARCHAR(50)
EXECUTE dbo.Usp_proc1
@CustomerID,
@p1_output OUTPUT,
@p2_output OUTPUT,
@p3_output OUTPUT
SELECT @p1_output AS cfname,
@p2_output AS clname,
@p3_output AS cstatus
END
GO
-- Example invocation of the wrapper
EXECUTE dbo.Usp_proc2 1
GO
-- Returns a rowset like this:
-- cFNAME cLNAME cSTATUS
------------------------- ----------------- ----------------------
-- John Smith Active
-- Cleanup
DROP PROCEDURE dbo.usp_proc2
DROP PROCEDURE dbo.usp_proc1
DROP TABLE dbo.customers
/*** End Example ***/
Once you've made your wrapper, you can execute it in SSRS as a separate dataset, and use the fields directly. Depending on where you use it, it may be necessary to use it with, e.g. the "First" function, which is an aggregate function that simply means to use the first (in this case only) row returned from the stored procedure call.
Friday, May 27, 2011
Q: How can I examine the contents of a SOAP envelope generated by my own proxy class?
A: Take a look at what this clever guy figured out how to do:
He used the SoapExtension class (http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.soapextension(VS.80).aspx)
to add logging to the proxy class, and viola! Cool, eh?
Labels:
.NET,
ASP.NET,
Web Services
Friday, April 8, 2011
Q: In SQL Server 2008, can you apply a service pack to the passive node in a cluster?
As it turns out, yes:
In SQL Server 2005, service packs had to be installed on the active node in a cluster. SQL 2008 removes that constraint, thus reducing total downtime.
Labels:
SQL 2008,
SQL Server
Thursday, February 10, 2011
Q: How does Microsoft Dynamics NAV integrate with SharePoint 2010?
A: I'll be the first to say that I know virtually nothing about MS Dynamics, but the question was asked, and as it happens the MS Dynamics NAV team have a blog post entitled "Microsoft Dynamics NAV Compatibility with Microsoft Office 2010 and Microsoft SharePoint 2010 - Microsoft Dynamics NAV Team Blog - Site Home - MSDN Blogs", which outlines some of the compatibility features, e.g. similar user experiences, ability to query Dynamics ERP & CRM databases via SharePoint BCS, which in turn allows synchronization of MS Dynamics information to Outlook & SharePoint Workspace, etc., etc.
Q: How do I control who is allowed to create My Sites?
A: By using "Manage User Permissions" in the User Profile Service Application administration tool. The default is that all users get the "Create Personal Site" permission. To change this, remove "Authenticated Users" and "All Authenticated Users" from this permission and add the AD global groups to which you want to grant the permission. This blog post from SharePoint expert Dave Coleman gives the details: Locking Down My Site SharePoint 2010 - SharePointEduTech
Subscribe to:
Posts (Atom)