Monday, August 11, 2008

.NET Framework 3.5 Enhancements Training Kit

Posted on/at 11:04 PM by Admin

Hi .NET Developers,

Published date of Training kit : 11-8-2008 Download

The .NET Framework 3.5 Enhancements Training Kit includes presentations, hands-on labs, demos, and event materials. This content is designed to help you learn how to utilize the .NET 3.5 Enhancement features including:

The following features had their labs updated in this release:
• ASP.NET AJAX History
• ASP.NET MVC
• ASP.NET Dynamic Data
• ADO.NET Data Services
• ADO.NET Entity Framework

The following features had labs added in this release:
• .NET Framework Client Profile
• WCF 3.5 SP1

The following features have supporting presentations included in this release:
• ASP.NET AJAX 3.5 SP1
• ASP.NET MVC
• ASP.NET Dynamic Data
• ASP.NET Routing
• ADO.NET Data Services
• ADO.NET Entity Framework
• WCF 3.5 SP1
• Visual Studio 2008 SP1

The following features have supporting demos included in this release:
• ASP.NET AJAX 3.5 SP1
• ASP.NET Dynamic Data
• ADO.NET Data Services
• ADO.NET Entity Framework

so you can download the training kit source from

http://www.microsoft.com/downloads/details.aspx?FamilyID=355C80E9-FDE0-4812-98B5-8A03F5874E96&displaylang=en



HTML Application (HTA)

Posted on/at 10:52 AM by Admin

if you want to open HTML page or website as an C++ application,Windows Application or any .Exe application, just rename the HTML file from .html to .hta . HTA can be used for prototyping, making wizards, or building full-scale applications.

By the use of HTA, you will focus on the html page or website content and thereby you won't find the browser toolbars, address bar, menus, buttons ...etc.

HTA for internal applications usage:

if you have internal tools, Web-Based applications, like attendance module for all employees, development team portals, collaboration portals, time tracker system ...etc. you need the employees or colleagues to dont care about explorer bars and focus on the core of your application, it will be useful to use the HTA

Example:




How can you do that:



just, you can rename the .html files to be .hta

OR,

you can use the following code:





references:
http://msdn.microsoft.com/en-us/library/ms536496.aspx
http://en.wikipedia.org/wiki/HTML_Application

Sunday, August 10, 2008

Naming Conventions for AX 4.0

Posted on/at 4:15 PM by Admin

Hi AX developers ,

According to my practical work on Microsoft Dynamics Ax 4.0 (Morphx IDE), it were obligated to use naming conventions for coding, design and implementation standards. I readed carefully "Best Practices for Microsoft Dynamics AX Development" View and summarized it then added some modifications to unify our development.

Naming Conventions for AOT









Naming Conventions for MorphX Controls





Naming Conventions for X++



these are some of naming conventions we used on ax development, you may customize naming conventions to your development state.
References:

Microsoft Certified.!

Posted on/at 1:08 AM by Admin




Saturday, August 9, 2008

Microsoft Dynamics AX 2009 demos

Posted on/at 1:54 AM by Admin

Hi, Microsoft Dynamics AX 2009 can help you meet the needs of your people as well as the evolving demands of your business. Watch the videos and learn more from resources that relate to four key business challenges



other videos at :

using SilverLight:

http://www.microsoft.com/dynamics/ax/product/demos.mspx

Using Windows Media Player:

http://www.microsoft.com/dynamics/ax/product/demos_wmv.mspx

Friday, August 8, 2008

Split string as Array in SQL

Posted on/at 5:09 PM by Admin

Hi,



i was in need to split string in T-sql but i can't find built-in function to do that, thereby i wrote a function to do the following:



By the use of T-SQL:



if you have string like "Ahmed,Eid,Salim" or Ids like "120,234,123,546"

and you need deal with that string as array on SQL DB Engine and find items of it.





The SQL Function like:

Tuesday, August 5, 2008

MCTS Exam 70-536 Microsoft® .NET Framework 2.0—Application Development Foundation [Sample]

Posted on/at 4:23 AM by Admin

Hi friends, I got MCTS certification

MCTS: Microsoft Certified Technology Specialist

It enables professionals to target specific technologies and distinguish themselves by demonstrating in-depth knowledge and expertise in their specialized technologies.

To earn the MCTS: .NET Framework 2.0 :
- Exam 70–536 TS: Microsoft .NET Framework 2.0–Application Development Foundation
- Exam 70–528 TS: Microsoft .NET Framework 2.0 – Web-Based Client Development

The following questions are samples of Exam 70-536

Question: 1

You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You
need to ensure that the dictionary is type safe.
Which code segment should you use?


A. Class MyDictionaryImplements Dictionary(Of String, String)
B. Class MyDictionary Inherits HashTable
C. Class MyDictionary Implements IDictionary
D. Class MyDictionary
End Class
Dim t As New Dictionary(Of String, String)
Dim dict As MyDictionary = CType(t, MyDictionary)

Answer: A

Question: 2

You write a class named Employee that includes the following code segment.


Private m_EmployeeId As String
Private m_EmployeeName As String
Private m_JobTitleName As String
Public Function GetName() As String
Return m_EmployeeName
End Function
Public Function GetTitle() As String
Return m_JobTitleName
End Function
End Class


You need to expose this class to COM in a type library. The COM interface must also facilitate
forward-compatibility across new versions of the Employee class. You need to choose a method
for generating the COM interface.
What should you do?


A. Add the following attribute to the class definition.
_Public Class Employee
B. Add the following attribute to the class
definition. _Public Class Employee
C. Add the following attribute to the class definition. _Public Class Employee
D. Define an interface for the class and add the following attribute to the class
definition. _Public Class EmployeeImplements
IEmployee

Answer: D

Question: 3

You are developing a custom event handler to automatically print all open documents.
The event handler helps specify the number of copies to be printed. You need to develop a
custom event arguments class to pass as a parameter to the event handler.
Which code segment should you use?


A. public class PrintingArgs {
private int copies;
public PrintingArgs(int numberOfCopies) {
this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}


B. public class PrintingArgs : EventArgs {
private int copies;
public PrintingArgs(int numberOfCopies) {
this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}
C. public class PrintingArgs {
private EventArgs eventArgs;
public PrintingArgs(EventArgs ea) {
this.eventArgs = ea;
}public EventArgs Args {get { return eventArgs; }}}
D. public class PrintingArgs : EventArgs {
private int copies;}

Answer: B

Question: 4

You use Reflection to obtain information about a method named MyMethod.
You need to ascertain whether MyMethod is accessible to a derived class. What should you do?


A. Call the IsAssembly property of the MethodInfo class.
B. Call the IsVirtual property of the MethodInfo class.
C. Call the IsStatic property of the MethodInfo class.
D. Call the IsFamily property of the MethodInfo class.

Answer: D

Question: 5

You are creating a class that uses unmanaged resources. This class maintains references to
managed resources on other objects. You need to ensure that users of this class can explicitly
release resources when the class instance ceases to be needed. Which three actions should you
perform? (Each correct answer presents part of the solution. Choose three.)

A.
Define the class such that it inherits from the WeakReference class.
B.
Define the class such that it implements the IDisposable interface.
C. Create a class destructor that calls methods on other objects to release the managed
resources.
D.Create a class destructor that releases the unmanaged resources.
E.Create a Dispose method that calls System.GC.Collect to force garbage collection.
F.Create a Dispose method that releases unmanaged resources and calls methods on other
objects to release the managed resources.

Answer: B, D, F

Question: 6

You are working on a debug build of an application.
You need to find the line of code that caused an exception to be thrown. Which property of the
Exception class should you use to achieve this goal?


A. Data
B. Message
C. StackTrace
D. Source

Answer: C

Question: 7

You need to write a code segment that performs the following tasks:

* Retrieves the name of each paused service.
* Passes the name to the Add method of Collection1.
Which code segment should you use?

A. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service where State = ‘Paused’”);for each (ManagementObject^
svc in searcher->Get()) {
Collection1->Add(svc[“DisplayName”]);}
B. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service”, “State = ‘Paused’”);for each (ManagementObject^ svc in
searcher->Get()) {
Collection1->Add(svc[“DisplayName”]);}
C. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service”);for each (ManagementObject^ svc in searcher->Get()) {
if ((String^) svc["State"] == "'Paused'") {
Collection1->Add(svc[“DisplayName”]);
}}
D. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher();searcher->Scope = gcnew
ManagementScope(“Win32_Service”);for each (ManagementObject^ svc in
searcher->Get()) {
if ((String^)svc["State"] == "Paused") {
Collection1->Add(svc[“DisplayName”]);
}}

Answer: A

Question: 8

You need to serialize an object of type List(Of Integer) in a binary format. The object is named
data. Which code segment should you use?

A. Dim formatter As New BinaryFormatter()Dim ms As New
MemoryStream()formatter.Serialize(ms, data)
B. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream() For i As
Integer = 1 To 20
formatter.Serialize(ms, data(i - 1))Next
C. Dim formatter As New BinaryFormatter()Dim buffer As New Byte(data.Count) {}Dim ms As
New MemoryStream(buffer, True)formatter.Serialize(ms, data)
D. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream()While
ms.CanRead formatter.Serialize(ms, data)End While\

Answer: A

Question: 9

You are developing an application that dynamically loads assemblies from an application
directory.
You need to write a code segment that loads an assembly named Company1.dll into the current
application domain. Which code segment should you use?


A. AppDomain^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->BaseDirectory,
“Company1.dll”);Assembly^ assm = Assembly::LoadFrom(myPath);
B. AppDomain ^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->BaseDirectory,
“Company1.dll”);Assembly^ assm = Assembly::Load(myPath);
C.AppDomain^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->DynamicDirectory,
“Company1.dll”);Assembly^ assm = AppDomain::CurrentDomain::Load(myPath);

D. AppDomain^ domain = AppDomain::CurrentDomain;Assembly^ assm =
Domain->GetData(“Company1.dll”);

Answer: A

Question: 10

You are testing a newly developed method named PersistToDB. This method accepts a
parameter of type EventLogEntry. This method does not return a value. You need to create a
code segment that helps you to test the method. The code segment must read entries from the
application log of local computers and then pass the entries on to the PersistToDB method. The
code block must pass only events of type Error or Warning from the source MySource to the
PersistToDB method.
Which code segment should you use?

A. EventLog myLog = new EventLog(“Application”, “.”);
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.Source == "MySource")
{
PersistToDB(entry);
}
}
B. EventLog myLog = new EventLog(“Application”, “.”);
myLog.Source = “MySource”;
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.EntryType == (EventLogEntryType.Error &
EventLogEntryType.Warning))
{
PersistToDB(entry);
}
}
C. EventLog myLog = new EventLog(“Application”, “.”);
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.Source == "MySource")
{
if (entry.EntryType == EventLogEntryType.Error
entry.EntryType == EventLogEntryType.Warning)
{
PersistToDB(entry);
}
}
}


D. EventLog myLog = new EventLog(“Application”, “.”);
myLog.Source = “MySource”;
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.EntryType == EventLogEntryType.Error
entry.EntryType == EventLogEntryType.Warning)
{
PersistToDB(entry);
}

Answer: C

Question: 11

You are developing a class library. Portions of your code need to access system environment
variables.
You need to force a runtime SecurityException only when callers that are higher in the call stack
do not have the necessary permissions.
Which call method should you use?


A. Set->Demant();
B. Set->Assert();
C. Set->PermitOnly();
D. Set->Deny();

Answer: A

Question: 12

You create the definition for a Vehicle class by using the following code segment.

Public Class Vehicle
_
Public vehicleType As String
Public model As String
_
Public year As Integer
_
Public miles As Integer
Public condition As ConditionType
Public Sub New()
End Sub
Public Enum ConditionType
BelowAverage
Average
AboveAverage
End Enum
End Class

You create an instance of the Vehicle class. You populate the public fields of the Vehicle class
instance as shown in the following table:

MemberValuevehicleTypecarmodelraceryear2002miles15000conditionAboveAverage
You need to identify the XML block that is produced when this Vehicle class instance is
serialized.
Which block of XML represents the output of serializing the Vehicle instance?


A.

racer
15000
AboveAverage

B.

racer
15000
Excellent

C.

racer
15000
Excellent

D.

car
racer
15000
Excellent

Answer: B

Question: 13

You are developing an application for a client residing in Hong Kong.
You need to display negative currency values by using a minus sign. Which code segment should
you use?


A. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatobjCulture.NumberNegativePattern = 1
Return NumberToPrint.ToString("C", objCulture)
B. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatobjCulture.CurrencyNegativePattern =
1Return NumberToPrint.ToString("C", objCulture)

C. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatReturn NumberToPrint.ToString("-{0}",
objCulture)
D. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatReturn NumberToPrint.ToString("()",
objCulture)

Answer: B

Question: 14

Your application uses two threads, named thread One and thread Two.
You need to modify the code to prevent the execution of thread One until thread Two completes
execution.
What should you do?


A. Configure threadOne to run at a lower priority.
B. Configure threadTwo to run at a higher priority.
C. Use a WaitCallback delegate to synchronize the threads.
D. Call the Sleep method of threadOne.
E. Call the SpinLock method of threadOne.

Answer: C

Question: 15

You are developing a method to hash data with the Secure Hash Algorithm. The data is passed
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?

A. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
NothingobjSHA.TransformBlock(message, 0, message.Length, hash, 0)
B. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
BitConverter.GetBytes(objSHA.GetHashCode)
C. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
objSHA.ComputeHash(message)
D. Dim objSHA As New SHA1CryptoServiceProviderobjSHA.GetHashCode()Dim
hash() As Byte = objSHA.Hash

Answer: C

Question: 16

You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You
need to ensure that the dictionary is type safe.
Which code segment should you use?


A. class MyDictionary : Dictionary
B. class MyDictionary : HashTable
C. class MyDictionary : IDictionary
D. class MyDictionary { ... }
Dictionary t = new Dictionary();MyDictionary dictionary =
(MyDictionary)t;

Answer: A

Question: 17

You work as a developer at Company.com. You are creating an application that provides
information about the local computer. The application contains a form that lists each logical drive
with the drive properties, such as type, volume label, and capacity.
You are required to write a procedure that retrieves properties of each logical drive on the local
computer.
What should you do?
Arrange the appropriate actions in the correct order.

Answer:


Question: 18

You are developing an application for a client residing in Hong Kong.
You need to display negative currency values by using a minus sign. Which code segment should
you use?


A. NumberFormatInfo^ culture =
gcnew CultureInfo(“zh-HK”)::NumberFormat; culture->NumberNegativePattern = 1;
return numberToPrint->ToString(“C”, culture);
B. NumberFormatInfo^ culture =
gcnew CultureInfo(“zh-HK”)::NumberFormat; culture->CurrencyNegativePattern = 1;
return numberToPrint->ToString(“C”, culture);
C. CultureInfo^ culture =
gcnew CultureInfo(“zh-HK”); return numberToPrint->ToString(“-(0)”, culture);
D. CultureInfo^ culture =
gcnew CultureInfo(“zh-HK”); return numberToPrint->ToString(“()”, culture);

Answer: B

Question: 19

You are developing a method to hash data with the Secure Hash Algorithm. The data is passed
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?

A. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash = nullptr;sha>
TransformBlock(message, 0, message->Length, hash, 0);
B. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash =
BitConverter::GetBytes(sha->GetHashCode());
C. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash = sha>
ComputeHash(message);
D. SHA1 ^sha = gcnew
SHA1CryptoServiceProvider();sha->GetHashCode();array^hash = sha->Hash;

Answer: C

Question: 20

You are writing an application that uses SOAP to exchange data with other applications.
You use a Department class that inherits from ArrayList to send objects to another application.
The Department object is named dept.
You need to ensure that the application serializes the Department object for transport by using
SOAP. Which code should you use?


A. SoapFormatter^ formatter = gcnew SoapFormatter();array^ buffer = gcnew
array(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
B. SoapFormatter^ formatter = gcnew SoapFormatter();array^ buffer = gcnew
array(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
formatter->Serialize(stream, dept);
C. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
D. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();formatter->Serialize(stream, dept);

Answer: D

Question: 21

You need to write a code segment that will create a common language runtime (CLR) unit of
isolation within an application. Which code segment should you use?

A. Dim mySetup As AppDomainSetup = _
AppDomain.CurrentDomain.SetupInformationmySetup.ShadowCopyFiles = "true"


.................. and so on so far

About Me

Developers house is a blog for posting technical articles in different technology like Microsft, Java, Oracle ..etc Microsoft technology includes c#,VB.net,ASP.net,Ajax,SilverLight,TFS,VS.NET 2003,2005,2008,2010 , SQL Server 2000, 2005 , Expression Blend , ...etc I hope it is helpful for all of you and if you are interested to post articles on it, only send me at ahmad.eed@gmail.com