How to run aspnet_regsql

Personally,  I prefer to use the wizard in running the executable file.

Just locate the file from C:\Windows\Microsoft.NET\Framework\[framework version]\aspnet_regsql.exe) and run the file as Administrator. Provide information as required by the wizard.

Finding special character in Excel cell

To find special character in excel cell and place a remark if found, you may use the formula below:

=IF(ISNUMBER(FIND({“!”,”@”,”’”,””””,”]”,”[“,”}”,”{“,”|”,”&”,”$”,”#”,”^”,”~”,”%”,”®”,”,”,”’”},F12)),”Found”,”None”)

Changing the data source of Form Authentication

I created my web application using the Web Form template in VS 2013. It was a quick installation setup where sample pages and the login module were already included.
The login uses the Default connection string which is sourced on the created .mdf file located the App_Data folder. It worked well without extra coding and configuration.
A week later, I decided to change my data source so that I can use my SQL Server membership database. It is not so complicated, just need to know where to do the changes in the application. Below are the steps I did:

1. Change the connection string in the web.config file from

<add name="DefaultConnection" connectionString="Data Source=(LocalDb)\v11.0;
AttachDbFilename=|DataDirectory|\aspnet-MindwebUniversity-20141127075146.mdf;Initial 
Catalog=aspnet-MindwebUniversity-20141127075146;Integrated Security=True"
 providerName="System.Data.SqlClient" />

to

<add name="ApplicationServices" connectionString="Data Source=Mindweb;Initial Catalog=MindwebUniversity; Persist Security Info=True; User ID=Username;Password=1234" providerName="System.Data.SqlClient"/>

2. Provide values on the Membership, Providers and Role Managers sections

  <membership>
 <providers>
 <clear/>
 <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
 </providers>
 </membership>
 <profile>
 <providers>
 <clear/>
 <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
 </providers>
 </profile>
 <roleManager enabled="true">
 <providers>
 <clear/>
 <add connectionStringName="ApplicationServices" applicationName="/" name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider"/>
 <add applicationName="/" name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider"/>
 </providers>
 </roleManager>

3. View the project properties and ensure to change the value in the fields as shown in the image below.

settings

 

 

Accessing the ASP.NET Web Configuration Tool in Visual Studio 2013

The ASP.Net Web Configuration Manager is not anymore available in Visual Studio 2013. If you need to run it in your development server or machine, the steps below would be of great help. Before doing these steps, ensure that your sites are running on .NET Framework 4.0 or higher.
1. Open the command prompt. Note: You need to open it not as an administrator.
2. You need to be in the IIS Express folder (E.g. C:\Program Files\IIS Express>) and paste the following prompt without a quote:

 “iisexpress.exe /path:C:\Windows\Microsoft.NET\Framework\v4.0.30319\
ASP.NETWebAdminFiles /vpath:/ASP.NETWebAdminFiles /port:8089 /clr:4.0 /ntlm"

Note: Use other port number if 8089 is already assigned.

iisexpress

3. Finally, paste this URL in your browser witout a quote:

"http://localhost:8089/asp.netwebadminfiles/default.aspx?applicationPhysicalPath=
C:\Users\drmindweb\Documents\Visual%20Studio%202013\Projects
\QualityModule\&applicationUrl=/"

Remove hyperlinks in Excel

Scenario (Applies to MS Excel)

When you type an entry in your worksheet that begins with any of the following prefixes, Microsoft Excel automatically creates a hyperlink:

• http://     • www.      • ftp://     • mailto:      • file://     • news:       • \\

Excel also creates a hyperlink when you type an e-mail address in the following format:  user name@company name.com

Task

Remove the hyperlinks of the data in a range in Excel. E.g. A1:A200

Approach

Use this VBA code to remove the hyperlinks:

Sub RemoveHyperlinks()

Range(“A1:A200”).Hyperlinks.Delete

End Sub

Quick Search Function

Scenario (Applies to MS Access)

I have a main form (frmSearch) with a subform (sfrmNamesList) by which its data source is a query (qrySearchNames). In a query, I added a Search field concatenating the fields that are included in the search (Search:[LastName] & ” ” & [FirstName] & ” ” & [Employee ID]). I set a criteria for the Search field as : Like “*” & [Forms!frmSearch!txtSearch] & “*”.

Task

Refresh the form that when the user enter a letter in the Search text box (txtSearch), the names of employees that match would display in the subform.

Approach

Create a module in VBA and place this code:

Public Function pfPositionCursor(ctl As Control, lngWhere As Long)
Select Case ctl.ControlType
Case AcControlType.acTextBox, AcControlType.acComboBox

ctl.SelStart = lngWhere
ctl.SelLength = 0

Case Else
’Do Nothing
End Select
End Function

Then, on the On Change Event of txtSearch, put this code:

Private Sub txtSearch_Change()
Me.Refresh
pfPositionCursor Me.txtSearch, Len(Me.txtSearch & “”)
End Sub