Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Sunday, August 16, 2020

How to make Microsoft Edge Chromium and Classis Edge run side by side

The Microsoft Edge Chromium is so good that you may not need to keep Classic Edge in your computer. But in case you need to keep both versions, here is a tip from https://geekermag.com/use-microsoft-edge-chromium-classic-edge-side-by-side/

Modify Window Registry using RegEdit to set this key to 1: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\EdgeUpdate
 

Make key EdgeUpdate if it does not exist.





Further reading:

Saturday, May 16, 2015

Northwind Sample DB Script is not work on SQL 2014

Comment out the line #24-25 in file "SQL Server 2000 Sample Databases\instnwnd.sql"


sp_dboption removed after SQL 2012

-- exec sp_dboption 'Northwind','trunc. log on chkpt.','true'
=> ALTER DATABASE Northwind SET RECOVERY SIMPLE

-- exec sp_dboption 'Northwind','select into/bulkcopy','true'
=> ALTER DATABASE Northwind SET RECOVERY BULK_LOGGED

Referenece:



Sunday, February 8, 2015

Free Windows 10 Upgrade

As I guessed in my post last year, the next version of Windows is a free upgrade to consumer of Windows 7, 8, and 8.1. I love it.

Saturday, February 15, 2014

Should Microsoft Windows Free?

Few days ago, I read this article "Microsoft should get used to giving Windows away for free" written by  Tony Bradley on TechRepublic. I like that idea. If Microsoft can not make Windows free as Ubuntu Linux, at least it should be free upgrade or low cost like Mac OS/X 10.7

Monday, September 16, 2013

ASP.NET Questions and Answers – Part 5

What is differences between an ADO.NET Dataset and an ADO Recordset?

  • ADO RecordSet looks like a single table. ADO.Net DataSet is collection of single or more tables.
  • ADO RecordSet can hold data from a single data source. ADO.Net DataSet can hold data from any data sources.
  • ADO RecordSet is a connected environment. ADO.NET DataSet is a collected of tables and it is a disconnected environment i.e., there is no constant connection with database.

What is the parent class of the Web server control?

The System.Web.Ul.Control class is the parent class for all Web server controls.

What are the various ways of authentication techniques in ASP.NET?

  • Windows Authentication - This is the default authentication technique. It can work with any form of Microsoft Internet Information Services (IIS) authentication, such as Basic, Integrated Windows authentication (NTLM/Kerberos), Digest, and certificates. The syntax of Windows authentication mode is given as follows:
  • Forms Authentication - You can specify this mode as a default authentication mode by using the following code snippet:
  • Passport - This mode works with Microsoft Passport authentication, as shown in the following code snippet:

Related posts:

Friday, September 6, 2013

Using ODBC 32-bit on 64-bit Operating System

Which ODBC driver should we install on 64-bit machine using Windows Server 2008 R2, Windows Server 2012, Windows 7, or Windows 8? It would depend. When I installed MySQL ODBC 64-bit driver on Windows 8.1 Preview, it worked when I added a new DSN. But, it did not work when Microsoft Access 2007 application made ODBC call to MySQL server.

What wrong? It took me couple hours to figure out. Microsoft Access 2007 may not work with other 64-bit driver or program yet. Installed MySQL ODBC 32-bit solve the problem.

On Windows 8.1, there are two ODBC Administrors under Control Panel – Administrative Tools. One for ODBC Datasources 32-bit and one for ODBC Datasources 64-bit. On Windows Server 2008 R2, there is only one reference to ODBC Administrator. This is 64-bit. Where is 32-bit? To add or manage DSN for ODBC 32-bit, you need to call program odbcad32.exe in C:\Windows\SysWOW64\

Hope this help.

Saturday, August 17, 2013

WAMP

WAMP stands for Microsoft Windows operating system, Apache web server, MySQL database, and PHP general-purpose scripting language for server side Web development. Among WAMP server packages, I like WampServer since it easy to instal, have latest version from Apache, MySQL and PHP and it's free. Before you install the WampServer, you need to make sure your computer have:

  • Microsoft Visual C++ 2010 run-time. Without Microsoft Visual C++ 2010 run-time, you will see the error message "vcr100.dll missing" when install.
  • Microsoft .NET Framework 3.5.1. This fixed the problem 'aestan tray menu has stopped' when you start the WampServer

To install Microsoft Visual C++ 2010 Redistributable Package (x64) ( http://www.microsoft.com/en-us/download/details.aspx?id=14632 )

On Windows 2008R2 server, make sure .NET Framework 3.5.1 enable. It disable by default. ( http://social.technet.microsoft.com/Forums/windowsserver/en-US/ac1bf719-0a88-4b5d-be98-395f2623e805/what-version-of-net-framework-comes-with-windows-2008-r2 )

Tuesday, July 9, 2013

C# Questions and Answers – Part 3

What is an anonymous class?
An anonymous class is a class that does not have a name. An anonymous class created by using the new keyword and and a pair of brace defining the fields and values.

How to prevent a calculation overflowed in C#?
Use checked keyword. For example: checked (operand1 + operand2); checked and unchecked keyworks are for integer arithmetic such as int and long

What is a partial class?
When we split a number of methods, fields, and constructors of a class into many files, we can use partial keyword.

Previous posts:
C# Questions and Answers
C# Questions and Answers – Part 2
C# Questions and Answers – Part 3

Sunday, June 30, 2013

Install Windows 8.1 Preview on VirtualBox

When I installed Windows 8.1 Preview on VirtualBox 4.2.14 hosted on Mac OS/X machine, I got this error:
“Your PC need to restart, Please hold down the power button Error Code : 0x000000C4”.

Here is a solution I found at https://www.virtualbox.org/ticket/10792:
Open terminal windows and execute this command:
VBoxManage setextradata [vmname] VBoxInternal/CPUM/CMPXCHG16B 1
where [vmname] is your Windows 8.1 virtual machine name.

Here is my screenshot: Install Visual Studio 2013 Preview on Windows 8.1 Preview

Update on July 10: You need to the Oracle VirtualBox 4.2.16 or later to install VirtualBox Addition in order to make the full screen, shared folder and other features.

Monday, June 24, 2013

Notes on MVC Music Part 7 Tutorial

When using Visual Studio 2012 and MVC 3 to practice the MVC Music Store tutorial, you may get this error on part 7:
‘CompareAttribute’ is an ambiguous reference between ‘System.ComponentModel.DataAnnotations.CompareAttribute’ and ‘System.Web.Mvc.CompareAttribute’

Here is the solution:
Remove the reference using System.Web.Mvc;
from MvcMusicStore\Models\AccountModels.cs

Tuesday, June 11, 2013

C# Questions and Answers – Part 2

What is a constructor?
A constructor is a special method with the same name as the class. It is executed when an instance of the class is created and can contain code to initialize the instance.
What is the difference between public, static and void?
All these are access modifiers in C#. Public declared variables or methods are accessible anywhere in the application. Static declared variables or methods are globally accessible without creating an instance of the class. Void specifies that the method does not return a value.
What is an interface?
An interface contains only the signatures of methods, delegates or events. The implementation of the methods is done in the class that implements the interface. Read more http://msdn.microsoft.com/en-us/library/87d83y5b(v=VS.80).aspx
What is a delegate?
Delegate is a reference type that can be used to encapsulate a named or an anonymous method. Delegates are similar to function pointers in C++; however, delegates are type-safe and secure. Read more http://msdn.microsoft.com/en-US/library/900fyy8e(v=vs.80).aspx

Previous posts:
C# Questions and Answers
C# Questions and Answers – Part 2
C# Questions and Answers – Part 3

Monday, June 10, 2013

Scan a whole drive for virus in Windows 8

  1. Go to desktop screen to using Windows Explorer or open command prompt windows.
  2. Change to folder C:\Program Files\Windows Defender
  3. Execute program c:msascui.exe

Monday, May 13, 2013

ASP.NET Questions and Answers – Part 4

Why we should using HttpUtility.HtmlEncode?
We should using HttpUtility.HtmlEncode method to sanitize the user input.This prevents users from injecting Javascrip into web application.

What is the difference between ASP.NET MVC 3 Web Application template and ASP.NET MVC 3 Empty Web Application?
One difference between the full ASP.NET MVC 3 Web Application template and the ASP.NET MVC 3 Empty Web Application template is that the empty template doesn’t include an Account Controller.

What is the difference between Session State and View State?
Both Session State and View State used to keep track data between the post back. Session State is server based. View State is a client based. (ASP.NET State Management Overview)

ASP.NET session state enables you to store and retrieve values for a user as the user navigates ASP.NET pages in a Web application. ASP.NET session state identifies requests from the same browser during a limited time window as a session, and provides a way to persist variable values for the duration of that session. (ASP.NET Session State Overview)

View state is the method that the ASP.NET page framework uses to preserve page and control values between round trips. When the HTML markup for the page is rendered, the current state of the page and values that must be retained during postback are serialized into base64-encoded strings. This information is then put into the view state hidden field or fields. (ASP.NET View State Overview).

Related posts:

Saturday, May 11, 2013

Notes on MVC Music Part 3 Tutorial

MVC Music Store is a great tutorial written by Jon Galloway. Using Visual Studio 2012 with MVC 4 Web Application Empty template, the following folders are note available:
  • /View/Shared
  • /Content/
  • /Scripts
Here are solutions:
  1. Drag /Content folder from MVCMusicStore-Assets.zip into MvcMusicStore solution folder in Visual Studio 2012. If you just drag and drop in Windows Explorer, make sure it 'included in the project'
  2. Select Manage Nuget Packagse under Project menu to install jQuery. The /Scripts folders will create under MvcMusicStore folder.
  3. Add folder Shared to /View folder
  4. Right click on /View/ folder to add MVC 4 Layout page (Razor) and named it _Layout.cshtml. Copy the code in tutorial into this file. Also correct version of installed jQuery script. Here, I used jquery-2.0.0.min.js instead of jquery-1.5.1.min.js
  5. Right click on /View/Shared folder to add MVC 4 Layout page (Razor) and named it _ViewStart.cshtml. Added the following codes to this file:
    @{
    Layout = "~/Views/Shared/_Layout.cshtml";
    }

Saturday, April 27, 2013

Antivirus on Microsoft Windows 8

Microsoft Windows 8 has built-in antivirus software called Windows Defender so we don’t need to install Microsoft Security Essential as in Microsoft Windows 7 or previous Windows version. If you need to install other third party antivirus software such as Norton Antivirus or McAfee, etc… you need to disable Windows Defender first. You cannot more than one antivirus software run at the same time. It will slowdown your machine and make it easy to crash.

I am much happy to use the Windows Defender on Microsoft Windows 8. It saves me at least fifty bucks per year on antivirus software.

Monday, March 11, 2013

ASP.NET Questions and Answers – Part 3

What is a master page?
A master page is a template for other web pages in your web application with shared layout and functionality. The master page defines placeholder for the content which can overridden by content pages.

What is the Global.asax file?
The Global.asax file, also known as the ASP.NET application file, is an optional file that contains code for responding to application-level events raised by ASP.NET or by HttpModules. The Global.asax file resides in the root of an ASP.NET based application. At run time, Global.asax is parsed and compiled into a dynamically generated .NET Framework class derived from the HttpApplication base class. The Global.asax itself is configured so that any direct URL request for it is automatically rejected; external users cannot download or view the code written within it. Read more at msdn.microsoft.com

What is the difference between ASP and ASP.NET?
  • ASP is interpreted. ASP.NET is compiled.
  • ASP uses VBScript. However, ASP.NET uses C# and VB.NET which are compiled to Microsoft Intermediate Language (MSIL).

Related posts:

Tuesday, January 29, 2013

C# Questions and Answers

What are namespaces?

Namespaces are heavily used in C# programming in two ways. First, the .NET Framework uses namespaces to organize its many classes. Second, declaring your own namespaces can help you control the scope of class and method names in larger programming projects. Use the namespace keyword to declare a namespace

Namespaces have the following properties:
  • They organize large code projects.
  • They are delimited by using the . operator.
  • The using directive obviates the requirement to specify the name of the namespace for every class.
  • The global namespace is the "root" namespace: global::System will always refer to the .NET Framework namespace System.
Read more at MSDN: Namespaces (C# Programming Guide)

Namespaces are a way of grouping type names and reducing the chance of name collisions. A namespace provides a fundamental unit of logical code grouping.
( Understanding and Using Assemblies and Namespaces in .NET )

What is the GAC?

GAC stands for global assembly cache. It is a machine-wide common language runtime code cache. The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.

Read more at MSDN: Global Assembly Cache

What is a class?

A class is a construct that enables you to create your own custom types by grouping together variables of other types, methods and events. A class is like a blueprint. It defines the data and behavior of a type.

For more information, see MSDN: Classes (C# Programming Guide).
Previous posts:
C# Questions and Answers
C# Questions and Answers – Part 2
C# Questions and Answers – Part 3

Monday, January 28, 2013

ASP.NET Questions and Answers - Part 2

How can we prevent browser from caching an ASPX page? 
Use the SetNoStore method of the HttpCachePolicy class to direct the client not to store the responses in its history. See http://msdn.microsoft.com/en-us/library/system.web.httpcachepolicy.setnostore.aspx

In which event are the controls fully loaded?
On Load event. (http://msdn.microsoft.com/en-us/library/system.web.ui.page(v=vs.100).aspx
The Page object calls the OnLoad method on the Page object, and then recursively does the same for each child control until the page and all controls are loaded. The Load event of individual controls occurs after the Load event of the page.
Use the OnLoad event method to set properties in controls and to establish database connections.
(http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx)

How we can force all the validation controls to run?
Using Page.Validate() method to instructs any validation controls included on the page to validate their assigned information.
Read more at http://msdn.microsoft.com/en-us/library/0ke7bxeh.aspx

What is .ASCX file?
.ascx file is a user control file.
Read more at http://msdn.microsoft.com/en-us/library/26db8ysc(v=vs.71).aspx

Related posts:

Wednesday, January 9, 2013

ASP.NET Questions and Answers

What is ASP.NET?
ASP.NET is a Web platform that provides all the services that you require to build enterprise-class server-based Web applications. ASP.NET is built on the .NET Framework, so all .NET Framework features are available to ASP.NET applications. Your applications can be written in any language that is compatible with the common language runtime (CLR), including Visual Basic and C#.
Source:  http://msdn.microsoft.com/en-us/library/dd566231%28v=vs.100%29.aspx

ASP.NET is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. ASP.NET is part of the .NET Framework, and when coding ASP.NET applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic and C#. These languages enable you to develop ASP.NET applications that benefit from the common language runtime, type safety, inheritance, and so on.
Source: http://msdn.microsoft.com/en-us/library/4w3ex9c2%28v=vs.100%29.aspx

What is a Cookie?
A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is usually a small piece of data sent from a website and stored in a user's web browser while a user is browsing a website. When the user browses the same website in the future, the data stored in the cookie can be retrieved by the website to notify the website of the user's previous activity. Cookies were designed to be a reliable mechanism for websites to remember the state of the website or activity the user had taken in the past.
Source: http://en.wikipedia.org/wiki/HTTP_cookie

Describe the complete ASP.NET page lifecycle.
  1. Page request: The page request occurs before the page life cycle begins. When the page is requested by a user, ASP.NET determines whether the page needs to be parsed and compiled (therefore beginning the life of a page), or whether a cached version of the page can be sent in response without running the page.
  2. Start: In the start stage, page properties such as Request and Response are set. At this stage, the page also determines whether the request is a postback or a new request and sets the IsPostBack property. The page also sets the UICulture property.
  3. Initialization: During page initialization, controls on the page are available and each control's UniqueID property is set. A master page and themes are also applied to the page if applicable. If the current request is a postback, the postback data has not yet been loaded and control property values have not been restored to the values from view state.
  4. Load: During load, if the current request is a postback, control properties are loaded with information recovered from view state and control state.
  5. Postback event handling: If the request is a postback, control event handlers are called. After that, the Validate method of all validator controls is called, which sets the IsValid property of individual validator controls and of the page. (There is an exception to this sequence: the handler for the event that caused validation is called after validation.)
  6. Rendering: Before rendering, view state is saved for the page and all controls. During the rendering stage, the page calls the Render method for each control, providing a text writer that writes its output to the OutputStream object of the page's Response property.
  7. Unload: The Unload event is raised after the page has been fully rendered, sent to the client, and is ready to be discarded. At this point, page properties such as Response and Request are unloaded and cleanup is performed.

Related posts:

Saturday, December 15, 2012

Microsoft Exam 70-480: Programming in HTML5 with JavaScript and CSS3

I passed the Microsoft Exam 70-480 Programming in HTML5 with JavaScript and CSS today. I am so happy. I took this exam for FREE! using this voucher code: HTMLJMP (voucher code available through 3/31/2013 or while supplies last). In the past few months, I spent sometime to learn and using HTML5, CSS3, JavaScript and JQuery. Here are some resources I used to learn: