Skip to main content

Posts

Showing posts from April, 2011

Publish/Upload the documents to document library from local hard drive

I am sharing function to upload your files on local hard drive to SharePoint document library. In my scenario I have a file on local hard drive and upload this to a SharePoint document library and delete the file presented on local drive. The source code is // For Publish file to library private void PublishWorkbook(string strTempLocalPath, string strLibraryURL, string strFileName)         {             SPSecurity.RunWithElevatedPrivileges(delegate()                    {                        using (SPSite siteCollection = new SPSite(SiteURL))                        {   ...

Get excel column name by a known integer number

I am sharing with you a small function that enables you to get excel column name by a known integer number. function private string GetExcelColumnName(int columnNumber) { int dividend = columnNumber; string columnName = String.Empty; int modulo; while (dividend > 0) { modulo = (dividend - 1) % 26; columnName = Convert.ToChar(65 + modulo).ToString() + columnName; dividend = (int)((dividend - modulo) / 26); } return columnName; } Way to call methods string strRange = GetExcelColumnName(5); output strRange = E