by admin | Jan 16, 2019 | Programming Notes, System
There might be a requirement to list all the filenames inside a folder. The steps below would be useful:
1. Hold the “Shift” key, right-click the folder containing a list of files and select “Open Command Window Here.”
2. Type dir > files.txt in the Command Prompt window. Press “Enter.”
3. A text file name files.txt is created in the folder selected.
by admin | Jan 12, 2019 | ASP.NET, Programming Notes
I need to get the number of Tasks in a project for the MaxValue property of Telerik ProgressBar and the numbers of completed tasks for its Value property. Below are the codes I used:
Public Sub progressBar()
Dim projectID As String = Me.txtID.Text
Dim db As New ProjectsEntities()
Dim totalTasks = Aggregate task In db.tblTasks
Where task.ProjectID = projectID
Into Count()
Dim totalTasksCompleted = Aggregate task In db.tblTasks
Where task.ProjectID = projectID And
task.TaskStatus = "Completed"
Into Count()
Me.TaskProgressBar.Value = totalTasksCompleted
Me.TaskProgressBar.MaxValue = totalTasks
Me.TaskProgressBar.ChunksCount = totalTasks
End Sub
For Average and Sum, below are codes copied from Microsoft Site.
Dim averageOrderCount = Aggregate cust In db.Customers
Where cust.City = "London"
Into Average(cust.Orders.Count)
msg &= "Average number of Orders per customer: " &
averageOrderCount & vbCrLf
Dim venezuelaTotalOrders = Aggregate cust In db.Customers
Where cust.Country = "Venezuela"
Into Sum(cust.Orders.Count)
msg &= "Total number of orders from Customers in
Venezuela: " & venezuelaTotalOrders & vbCrLf
MsgBox(msg)
Dim averageCustomersByCity = From cust In db.Customers
Group By cust.City
Into Average(cust.Orders.Count)
Order By Average
by admin | Apr 11, 2016 | Programming Notes, SharePoint
Requirement: Rename ID field in a SharePoint list! We had a list with ID column added to the view to provide unique auto number feature. User wants to rename ID field to “Change Request Number” as it sounds more appropriate.

Solution: Hidden columns such as “ID”, “Workflow Status” are not providing Edit features directly from SharePoint web UI and they don’t even appear on SharePoint list settings page.
So, use this simple trick to rename any hidden column such as ID:
Go to List settings page  and Pick any column such as “Title”. You’ll get Edit Column page.
In the URL, Change the Field parameter from “Title” to “ID” and Hit Enter. E.g.
http://demo.crescent.com/_layouts/15/FldEdit.aspx?List=%7BB9BED485%2D889D%2D49D9%2DBDC1%2DD78EB4E06EB9%7D&Field=Title
To
http://demo.crescent.com/_layouts/15/FldEdit.aspx?List=%7BB9BED485%2D889D%2D49D9%2DBDC1%2DD78EB4E06EB9%7D&Field=ID
Source: SharePoint Diary
by admin | Mar 21, 2016 | Programming Notes, SharePoint
In their infinite wisdom, Microsoft decided to remove the ‘sign in as another user‘ option from the UI. For consultants and developers who need to test their solutions in an ongoing manner, user accounts need to be switched in order to test the myriad of permission issues sometimes experienced by users.
After some extensive research I have found a solution:
Simply append the following behind your URL – /_layouts/closeConnection.aspx?loginasanotheruser=true
e.g http://yoursite/_layouts/closeConnection.aspx?loginasanotheruser=true
Source: Potifar5000
by admin | Mar 20, 2016 | ASP.NET, Programming Notes, SQLSERVER
My fresh installation of MS SQLSERVER 2014 in Windows Server 2012 was not successful due to the error mentioned in the title of this post. Its resolution is presented below:
- I remove the SQLSERVER 2014 installation using the Control Panel ->Programs -> Uninstall Program.
- I did a fresh install by running the Setup as an Administrator.
- In the Server Configuration page after launching the setup and providing necessary details, I used NT Authority\SYSTEM  as startup account for Database Engine services.
by admin | Apr 21, 2015 | ASP.NET, Programming Notes
I used a master on pages of my ASP.NET application. CSS and Script files were used in the master using a reference lines as:
<link rel="stylesheet" href="css/style.css" runat="server" />
<script src="js/jquery.min.js"></script>
It works on pages on same root where the CSS and Script folders are located but it never worked in another pages which are located in other folders. I resolved this issue by changing the references as follows:
<link rel="stylesheet" href="~/css/style.css" runat="server" />
<script src=’<%# ResolveUrl("~/js/jquery.min.js")%>’ type="text/javascript"></script>
There’s a line in script that I changed as well to ensure that the file is linked correctly.