Skip to main content

Posts

Showing posts from 2012

SharePoint 2013 Chrome Control not applying style to SharePoint app

I have include a chrome control to my app using  reference specified in here . But in the first time it didn’t work properly. it just gave a page with out any styles. But then inspecting errors I found jQuery library not loading correctly using the reference link   http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js So I installed the jQuery to my project using nugget manager (you can do it manually as well)  and change the js reference to the project. so it worked for me.

An exception of type System.Management.Automation.CmdletInvocationException was thrown. Additional exception information: ErrorCode:SubStatus:Service running under Network Service account in workgroup environment is not supported.

This error occurred to me when I ran the product configuration wizard in the SharePoint 2013 Preview in the Standalone Mode. I found that is is because of the AppFabric running account. Thus opening the SharePoint Management Shell and executing the following command resolved my issue. psconfig.exe -cmd Configdb create SkipRegisterAsDistributedCacheHost

Advanced InfoPath Development @ SharePoint Forum

Info path advanced development @ Sri Lanka SharePoint Forum from Melick Baranasooriya

Object null reference Error when opening the Site / Document Library in the SharePoint

  Server Error '/'  Application Object reference not set to an instance of an object Description: An unhandled exception was generated during the execution of the current web request. please review the stack trace for more information about the error and where it orginated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.]      Microsoft.office.server.Administration.UserProfileApplicationProxy.get_ApplicationProperties()  +134 Microsoft.office.server.Administration.UserProfileApplicationProxy.get_PartitionIDs() +44 Microsoft.office.server.Administration.UserProfileApplicationProxy.IsAvailable(SPServiceContext ServiceContext) +134 // ----------------------------------------------------------------------------------------------------------------------------- This error occurred in SharePoint installation on Windows Hom

Create Client Context To Access SharePoint 2013 (Office 365 Preview) in AutoHosted SharePoint App Model using SharePoint client object model (CSOM)

If we are using SharePoint app model AutoHosted Environment we need to use Client Context model to access SharePoint. Therefore First you need to get a Valid Access Token from SharePoint Server. For that you need to pass the SharePoint Site Url (This is available as SPHostUrl in the Query String) and Context Token that we can generate from passing the request Object . TokenHelper Class provides methods that used can be used to access the SharePoint server and generate Access Tokens. 1. Get the Context Token by passing the HttpRequest String context = TokenHelper .GetContextTokenFromRequest(Request); 2.Then get the Uri from the query string which provides the path to SharePoint server. Uri SharePointUri = new Uri (Request.QueryString[ "SPHostUrl" ]); 3. Then validate and generate access Token SharePointContextToken contextToken = TokenHelper .ReadAndValidateContextToken(context, SharePointUri.Authority); String AcessToken = TokenHelper .GetAccessToken(contextToken, shar

How to center a Div Horizontally and Vertically

  .wrapper { width : 100% ; height : 100% ; background-color : aqua ; } .body { width : 600px ; height : 300px ; background-color : #567 ; position : absolute ; left : 50% ; top : 50% ; margin-left : -300px ; margin-top : -150px ; } we set wrapper class to parent container. then set body css to child div which needs to center in the screen.  

Access to this web server is disabled by default because it is controlled by Basic Authentication and does not use Secure Socket Layer (SSL). Do you want to search the Microsoft Online Support Center to view possible solution?

I got this error when i tried to connect to  a SharePoint site using SharePoint designer. since I'm using Windows7 home premium as my development environment i configured the SharePoint to use basic  authentication which does not support SSL authentication. But Microsoft provide hot fix to overcome this situation. You need to download and install the fix mentioned below. [Microsoft Fix it 50711] http://go.microsoft.com/?linkid=9777384

The specified dsn contains architecture mismatch between the driver and application

This is a common error that is raising when 32bit applications and 64appications working together. therefore if you wan to create a 32bit DSN you should refer the 32bit DSN (ODBC) exe to create the DSN. therefore you need to go to the folder called C:\Windows\SysWOW64. Therefore you need to run the ODBC exe in the location C:\Windows\SysWOW64\odbcad32.exe to over come the situation. WOW is abbreviated as Windows on Windows

Calculated Columns in .NET Data Tables (C#)

Recently I had a requirement to add Calculated Columns to Data Table. For an example I’m Only providing Amount and Quantity. Then discount will be calculated automatically. String Discount = ".1" ; DataTable workTable = new DataTable ( "Customers" ); DataColumn workCol = workTable.Columns.Add( "ID" , typeof ( Int32 )); workTable.Columns.Add( "UnitPrice" , typeof ( Double )); workTable.Columns.Add( "Quantity" , typeof ( Int16 )); workTable.Columns.Add( "Total" , typeof ( Double )); workTable.Columns.Add( "Discount" , typeof ( Double )); workTable.Columns[ "Total" ].Expression = "UnitPrice*Quantity" ; workTable.Columns[ "Discount" ].Expression = String .Format( "Total*{0}" ,Discount); Later you can bind the Data Table to a Grid View if you need. dataGridView1.DataSource = workTable; dataGridView1.Update(); Special Note: But my requirement was to update the Column Expression dynam

Dynamically set Label BackColor (Control Back Color) in ASP.NET Grid

I engaged with fining a method of dynamically change control’s background color in a ASP.NET grid based on data in the data source. I used the following code for get the task done. < asp : TemplateField HeaderText ="Color 01"> < ItemTemplate > < asp : Label ID ="lblColor1" runat ="server" BackColor =' <% # System.Drawing.ColorTranslator.FromHtml((String)Eval("Color1")) %> ' Text =' <% # Bind("Color1") %> ' > </ asp : Label > </ ItemTemplate > </ asp : TemplateField >

ie window.open not working

When I tried to open a new window using JavaScript it worked for Google Chrome and IE. but didn’t work in IE. window.open( 'url ' , 'B HELP' , 'width=650' ); I found that space character in title bar cause the error. Therefore I used the following code and it worked fine. window.open( 'url ' , 'B-HELP' , 'width=650' );

@ NetAssist–24 June 2012 (9.00 am–1.00 pm)–Day 1

@ NetAssist–24 June 2012 (9.00 am–1.00 pm)–Day 1 View more PowerPoint from Melick Baranasooriya Questions Asked ? About partial and full trust environments Offline Database in MS that can use for small applications SharePoint Web Services SharePoint Flavors What is the authentication mechanism use by SharePoint in Windows7 as a development environment

@ NetAssist–24 June 2012 (9.00 am–1.00 pm)

Day One – Intro (24 June 2012 )

Role Based Security Using Form Authentication in ASP.NET , <Location path=’’ > not working and Login page does not have permission for anonymous users

I have created ASP.net web based application using Form Authentication. I need a section with role privileges and login page should be access by all users. when I specify the authorization in default section my login page loaded with out CSS since those files do not have permissions. Thus I used following approach and it worked for me. < system.web > < authentication mode = " Forms " > < forms name = " SomeName " loginUrl = " Login.aspx " slidingExpiration = " true " protection = " None " path = " / " defaultUrl = " Home.aspx " timeout = " 20 " > </ forms > </ authentication > </ system.web > <!-- Permision for the site --> < location allowOverride = " true " > < system.web > < authorization > < deny users =

Central Administration Page gives Blank Page

I have recently installed SharePoint 2010 in Windows 7 Home premium as described in http://msdn.microsoft.com/en-us/library/ee554869.aspx but it gave an a blank page when I tried to start the central administration page. then after searching in the Net I found that windows 7 home edition , premium edition and some other editions need to enable basic from authentication in the IIS. therefore  click the the relevant central administration web site and go to authentication option and change the basic authentication enabled.

An exception of type Microsoft.SharePoint.Upgrade.SPUpgradeException was thrown. Additional exception information: Failed to call GetTypes on assembly Microsoft.Office.Server.Search, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c. Could not load file or assembly 'System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I recently installed SharePoint 2010 in My Windows & machine. It gave me this error. I have found that Ms Chart control in not installed in my machine. i downloaded and installed it. It worked.. :-) http://go.microsoft.com/fwlink/?LinkID=122517

The file is being used by another program Excel InteropServices

Recently my friend faced a problem when automating a program that written using excel InteropServices. This program work perfectly in debug mode  and Windows XP. but when it try to automate using task scheduler in Windows 7 , Vista and upper version it is giving following errors. The file name or path does not exist The file is being used by another program The workbook you are trying to save has the same name as the currently opened book The file name or path does not exist The file is being used by another program The workbook you are trying to save has the same name as the currently opened book So creating a Desktop Folder in a following path resolved the issue. C:\Windows\System32\config\systemprofile\Desktop Refer: http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91

[IBM][isereis Access ODBC] .. SQL query exceeds specified time limit or storage limit ..

I got this exception when I tried to execute a query using DB2 ODBC script. There fore I found that ODBC property has a time out option which we can used to omit this problem. go to configuration section and then Performance section and click  Advanced button. and clear the option “ Allow Query Time out ”

Slowly Changing Dimension (SCD) in SSIS is slow (Taking long time)

I encountered a problem when using the slowly changing dimension (SCD) in large databases. SCD is easy and fast when it comes to less number of records. therefore I used following mechanism to  speed up the process using available SSIS components. First record set is send through Lookup command . in there we are checking that item is already available with the table. If yes we are redirecting to UPDARE Command and If not we are redirecting to Insert Command . But make sure following redirect option (Redirect rows to no match output) is set in the lookup component.

How to convert String to Enum Type in C#

This is a common question that we need in most of the time in developing. .NET provides powerful function in Enum Class to do that. enum DBType { SQLSERVER, ACCESS, SQLCE } private static DBType getDBType() { String dbType = "SQLCE" ; return ( DBType ) Enum .Parse( typeof ( DBType ),dbType); }

Extensions Methods in C#

C# extensions can be used to extended the  functionality of already written class. (Yes it is true that we can use it for our classes as well. But then we can add the method directly rather than having it as extension method) Following example shows a extension method which I used for extend the functionality of the windows.form class. public static class Extensions { public enum SpliterModes { PanelOne,PanelTwo } public static void Show( this Form frm, String name) { frm.TopLevel = false ; frm.Visible = true ; frm.FormBorderStyle = FormBorderStyle .FixedSingle; frm.MaximizeBox = false ; frm.Text = name; } }

Use Member Properties, Filter and With keyword in MDX

This is not a complete post. I came across a situation that I needed to show [Date] dimension values which is not empty as report parameter. But I need yeas that only have values in measure. there for I used following MDX to get that. with member yKey as [ Date ].[ Year ].currentmember.uniquename member yValue as [ Date ].[ Year ].currentmember.MEMBER_CAPTION select {yKey,yValue} on 0, { filter([ Date ].[ Year ].[ Year ],[Measures].[Total Amount]<> null ) } on 1 from [RetailigenceBI] this code result in getting

How to get Member Properties in MDX

Normally  MDX queries are returning caption for reports when we are using data in SSRS. But  we need other information such as UniqueNumber and other when passing as parameters to other reports and datasets. Below shows example query used for get the member properties. (We can declare it using WITH MEMBER ). DayKey is the custom column we are creating with member DayKey as [Date].[Date]. currentmember . uniquename SELECT NON EMPTY { DayKey ,[Measures].[Sample], [Measures].[Sample2] } ON COLUMNS , NON EMPTY { [Date].[Year-Month-Date].[Date]. ALLMEMBERS } ON ROWS FROM [RetailigenceBI]

Month Sorting Issue in SQL Server Reporting Services (SSRS)

This error Occurred to me while I design the query in the Query Builder and generate the report in SSRS ( MDX). Months are showing alphabetical order (April , August,..) , but it should be January , February .. I did some background works and even follows the the thread http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/27765eda-371d-4428-ab13-2e96b2fbb6ca . But ultimately I  found there is a sorting adding by default to that column. I Deleted it .. Bingo .. It worked ..  

Cross-thread operation not valid: Control xxx accessed from a thread other than the thread it was created on.

This error is occurring when  you are going to access the UI with another thread. There are method you can use to over come this situation. The best approach is to use method Invoker to update the UI when it is required. if (txtDataRx.InvokeRequired) { txtDataRx.Invoke( new MethodInvoker ( delegate { txtDataRx.Text = txtDataRx.Text + szData; })); } else { txtDataRx.Text = txtDataRx.Text + szData; }

user profile synchronization service not starting in SharePoint 2010

I had a difficult time to get user profile service synchronization started. Following are the errors encountered to me when I tried to start the synchronization manually as well as through SharePoint. Errors Encountered Windows could not start the forefront identity manager synchronization services on local computer The system cannot find the file specified. … Windows could not start the forefront identity manager synchronization services on local computer You account is not a member if a required security group (came from Forefront Identity Manager) The Forefront Identity Manager Service cannot connect to the SQL Database Server. Windows Could not start the Forefront Identity Manager Synchronization Service on local. for more info review the system event log. If this is a non Microsoft service contact the vendor and refer the specific error code 2145185792. Workaround These are things we need to consider to make it work. First make sure you don’t give fully qualified

How to add a Active Directory Domain Controller to Windows server 2008

This Active directory configuration I have did to configure VPC with SharePoint and  Active Directory services. First you need to run the Active Directory service binary installation. therefore you need to run the “ dcppromo ”. Thus you can simply type it in the run window to execute it. Then it checks the Domain services installations and prompt you for selection mode. Select Use advanced mode installation and proceed to next. This will prompt a compatibility note. So make it next to proceed. Then it will ask for forest configuration. since this is a new configuration we want to select create a new forest root domain . after that it is asking domain name for the forest. therefore you can provide a fully qualified name for the domain. the it will prompt for net bios name (you can leave the default) After that it will ask the functionality level. I choose Windows Server R2. You can see the available functionalities in the description itself. And Click the DNS. Then it