Dave's Technophorical Times

A blog about Microsoft's Technologies!
SharePoint :: MVC :: ASP.NET :: IIS :: SQL Server :: Visual Studio :: MS Access

1. Run regedit

2. Go to HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Common (repeat for muliple versions of MS Office)

3. Create a KEY called "Security" here by right clicking on the Common key and selecting New->Key and typing "Security"

4. Create a DWORD in the Security key by right clicking on Security, selecting New->DWORD and type in "DisableHyperlinkWarning"

5. Change the value of this DWORD to 1



Someone created a VM for me recently and everyime I launched IE to get to our SharePoint site internally I was being prompted to login. So I changed the IE Setting to use my credentials to log in automatically. That was OK for the time I was on the VM. BUT, when I went back in it asked me again and my settings in IE had been reverted.

This was so annoying that I Googled it and found out that it was the IE Enhanced Security Configuration that was causing this problem. So I switched it off and not it doesn't prompt me any more :-)



You write some LINQ code to update your SQL tables like this below BUT it does not throw an exception and it does not Update the tables!

using (var db=new SomeDatabaseContext())
{
     db.SomeTable
       .Where(x=>ls.Contains(x.friendid))
       .ToList()
       .ForEach(a=>a.status=true);

     db.SubmitChanges();
}

The reason why is because your Table does not have a Primary Key! You can update your DBML designer to have that Primary Key and you don't need to touch the actual SQL Server tables for this to work!

Best of Luck.



WITH  q AS
        (
        SELECT TOP 1 *
        FROM    mytable
        /* You may want to add ORDER BY here */
        )
DELETE
FROM    q

Note that

DELETE TOP (1)
FROM   mytable

will also work, but, as stated in the documentation:

The rows referenced in the TOP expression used with INSERT, UPDATE, or DELETE are not arranged in any order.

Therefore, it's better to use WITH and an ORDER BY clause, which will let you specify more exactly which row you consider to be the first.



ALTER FUNCTION [dbo].[fnGetPipelineProductsCarried]
 (
  @GIS_PipelineMasterId INT,
  @EnglishOrFrench NVARCHAR(20) = 'English'
 )
RETURNS VARCHAR(1000)
AS 
 BEGIN
  DECLARE @ReturnEnglish VARCHAR(1000) = ''
  DECLARE @ReturnFrench VARCHAR(1000) = ''
  DECLARE @ProductCarriedName NVARCHAR(255) = ''
  DECLARE @ProductCarriedNameFrench  NVARCHAR(255) = ''
  DECLARE @TempTable TABLE (
          PipelineName NVARCHAR(255),
          ProductCarriedName NVARCHAR(255),
          ProductCarriedNameFrench NVARCHAR(255),
          SUBABC NVARCHAR(5),
          PercentH2S DECIMAL(18,3),
       GIS_ProductCarriedTypeId INT,
       GIS_PipelineMasterId INT,
       DummyID INT IDENTITY(1,1) NOT NULL
  )

  INSERT INTO @TempTable  
  SELECT DISTINCT
      pm.PipelineName,
      pct.ProductCarriedName,
      pct.ProductCarriedNameFrench,
      pspc.SUBABC,
      pspc.PercentH2S,
      pspc.GIS_ProductCarriedTypeId,
      ps.GIS_PipelineMasterId
    FROM ((GIS_PipelineSegment ps
   INNER JOIN GIS_PipelineSegmentProductCarried pspc ON ps.GIS_PipelineSegmentId = pspc.GIS_PipelineSegmentId)
   INNER JOIN GIS_PipelineMaster pm ON ps.GIS_PipelineMasterId = pm.GIS_PipelineMasterId)
   INNER JOIN GIS_ProductCarriedType pct ON pspc.GIS_ProductCarriedTypeId = pct.GIS_ProductCarriedTypeId
   WHERE pm.GIS_PipelineMasterId = @GIS_PipelineMasterId
   ORDER BY pm.PipelineName,
      pspc.SUBABC;

  --Counters
  DECLARE @count INT
  DECLARE @count_max INT
  
  SET @count = 1
  SELECT @count_max = COUNT(DummyID) FROM @TempTable

  WHILE(@count <= @count_max)
  BEGIN
   SELECT @ProductCarriedName = ProductCarriedName,
             @ProductCarriedNameFrench = ProductCarriedNameFrench
     FROM @TempTable
    WHERE DummyID = @count
  
   SET @ReturnEnglish = @ReturnEnglish + @ProductCarriedName + ', '
   SET @ReturnFrench =  @ReturnFrench  + @ProductCarriedNameFrench + ', '
   
   --Must Always be at the end of the Loop
   SET @count = @count + 1
  END
  
  IF @EnglishOrFrench = 'English'
  BEGIN
   SET @ReturnEnglish = CASE @ReturnEnglish
                        WHEN NULL THEN NULL
                        ELSE (CASE LEN(@ReturnEnglish)
                              WHEN 0 THEN @ReturnEnglish
                              ELSE LEFT(@ReturnEnglish, LEN(@ReturnEnglish) - 1)
                              END )
                        END
 
   RETURN @ReturnEnglish
  END
  ELSE
  BEGIN
   SET @ReturnFrench = CASE @ReturnFrench
                       WHEN NULL THEN NULL
                       ELSE (CASE LEN(@ReturnFrench)
                             WHEN 0 THEN @ReturnFrench
                             ELSE LEFT(@ReturnFrench, LEN(@ReturnFrench) - 1)
                             END )
                       END

   RETURN @ReturnFrench
  END   
  
  RETURN @ReturnEnglish  
   
 END



Error: TF400018: The local version table for the local workspace MY-PC;My User could not be opened. The workspace version table contains an unknown schema version.

Fix

Backup the folder first!

  • Click the box in "Workspace".
  • Click on "Workspaces".
  • Delete the workspace profile you're currently using
  • Re-connect to TFS open "Source Control"


  • So I just wasted 2 1/2 hours tring to figure out the WHY the Tab ordering was not working on my Form (C# project Visual Studio 2010).

    No matter what I did the order DID NOT CHANGE. There are all kinds of controls like Groupboxes, Panels with Controls inside Controls. No big deal. The View -> Tab Order feature made NO DIFFERENCE at all!!

    The only way the tab Order worked was by actually updating the DESIGNER to order the Controls in the way I wanted! Like this...

                this.pnlSubAbc.Controls.Add(this.lblProductA);
                this.pnlSubAbc.Controls.Add(this.cboProductA);           
                this.pnlSubAbc.Controls.Add(this.lblProductAH2S);
                this.pnlSubAbc.Controls.Add(this.txtProductAH2S);  
                this.pnlSubAbc.Controls.Add(this.lblProductB);
                this.pnlSubAbc.Controls.Add(this.cboProductB);        
                this.pnlSubAbc.Controls.Add(this.lblProductBH2S);
                this.pnlSubAbc.Controls.Add(this.txtProductBH2S);
                this.pnlSubAbc.Controls.Add(this.lblProductC);
                this.pnlSubAbc.Controls.Add(this.cboProductC);
                this.pnlSubAbc.Controls.Add(this.lblProductCH2S);
                this.pnlSubAbc.Controls.Add(this.txtProductCH2S);
                this.pnlSubAbc.Location = new System.Drawing.Point(3, 344);
                this.pnlSubAbc.Name = "pnlSubAbc";
                this.pnlSubAbc.Size = new System.Drawing.Size(562, 212);
                this.pnlSubAbc.TabIndex = 2;
                this.pnlSubAbc.TabStop = false;
                this.pnlSubAbc.Text = "Products Carried";

    Hope this Helps someone else out there.



    Issue: You are performing an Sharepoint upgrade (via PSConfig.exe as mentioned here for example) but got the error Message "Cannot open SPTimerV4 service on computer '.'." as seen below:

    An error has occurred while validating the configuration settings.  
    An exception of type System.InvalidOperationException was thrown. 
    Additional exception information: Cannot open SPTimerV4 service on computer '.'.
    Solution: Make sure you are running the Powershell with "Run as Administrator" even if the account you are using has local Admin rights.



    One of our Clients were experiencing an issue while Opening one of the SharePoint 2010 Lists in Access. They were essentially Clicking on one of the links “Open in Access” from List’s Ribbon that would result in the following error.

    “Export to database failed. To export a list, you must have a Microsoft SharePoint Foundation-compatible application.” To resolve this Download and Install the below hotfix for 32-bit Office and then restart your computer.

    http://support2.microsoft.com/hotfix/KBHotfix.aspx?kbnum=2553170&kbln=en-US  



    From here: https://dougieflash.wordpress.com/2013/03/08/updates-are-currently-disallowed-on-get-requests-to-allow-updates-on-a-get-set-the-allowunsafeupdates-property-on-spweb/

    If you are in Central Administration > Manage Web Applications and go to the General settings option,
    you might run into this error:

    · “Updates are currently disallowed on GET requests.

    · To allow updates on a GET, set the ‘AllowUnsafeUpdates’ property on SPWeb.

    · Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID: e845bd26-f70b-4f65-a023-82ca9d126031”

    This error occurred in my dev environment. The behavior was that new applications would throw this error,

    “Updates are currently disallowed on GET requests” under the General Settings. The error stack trace mentioned

    ‘EnsureHttpThrottleSettings’ so it means that CA is trying to update these setting on a GET request for new apps
    that don’t already have them.

    Resolution via Powershell

    Launch Powershell and and add these lines:

    $w = get-spwebapplication http://yourwebapplication
    $w.HttpThrottleSettings
    $w.Update()

    The call to the HttpThrottleSettings ensures they exist and Update() saves them.

    After completing these commands, you should be able to successfully launch the General Settings dialog window.



    The Blogger

    Dave Stuart I'm a Developer with a passion for coding. I enjoy the challengers that come with the job! SharePoint is one of my expert areas along with .NET Web Development with MVC and good old MS Access VBA coding. I Blog so that I can remember how I did that way back when; PLUS all this stuff is searchable! I constantly study and run my own business, Dafran Inc. I have passed 22 Microsoft Exams since 1998 when I first jumped on the treadmill of knowledge. I hope that you enjoy this Blog as much as I enjoy updating it. All the very best from Calgary, Alberta, Canada. contact me at linkedin @ dafran.ca

    Calendar

    <<  May 2017  >>
    MoTuWeThFrSaSu
    24252627282930
    1234567
    891011121314
    15161718192021
    22232425262728
    2930311234

    View posts in large calendar

    Sign in