Interested on Microsoft technologies? Read Visual Studio Dot Net

The recent boom in field of Information Technology has seen a steep rise in the demand of trained professionals in PHP and MySQL. Software companies specializing in php mysql web development are always searching for skilled professionals for recruitment in several important projects. The current supply of PHP experts is much below par, in terms of potential growth in the industry.

To train the educated work force in this regard various MySQL and PHP training courses have been developed. These courses provide elaborate training to the professionals for developing website with the usage of these languages.

PHP Training Objectives

Two main objectives of php and mysql web development program are:

• To develop skills to create interactive and data-driven sites

• Skill development for database creation in MySQL programming

Prerequisites For Training

The most important criteria for acquiring PHP training is thorough knowledge of HTML. The course should focus on any level in programming for teaching database creation.

On the other hand there are courses for fresher in the field of php and mysql web development. Some institutes like Indus Net Academy, has launched ACE Web Developer course with the aim of teaching real applications in PHP and MySQL. These courses are beneficial for creating awareness among candidates about programming language.

Course Details

Once you get enrolled into these training courses you can acquire knowledge in areas like PHP Programming Fundamentals, Strings Functions, Arrays Functions, HTML/CSS and Forms, File Handling and Email Handling in PHP, Object Oriented PHP and Session Handling etc. On the other hand, the ACE Web Developer course emphasizes on other programming languages such as MySQL Basics, Extended PHP, OOPS in PHP 5, Exception handling in PHP 5, XML / SOAP etc.

Another vital aspect of these php mysql development courses are; 70% hands-on and 30% lecture ratio, as far as the training part of the course are concerned. By engaging the students in live projects the courses ensure that the students have a thorough understanding of the actual application of such programming languages.

So if you have some knowledge about HTML, then you can get online training as well as work as a freelancer for php mysql web development. Some of the requirements essential for learning this programming language are:

• A personal computer at home
• Linux, Windows, MacOS X, or Solaris operating system
• Web server (either Apache httpd or Microsoft IIS)
• PHP 5 or later with the PEAR extensions enabled
• MySQL 4.1 or later (5 or later recommended)
• Internet Explorer 6 or Firefox 2

PHP programmers can now get quality work through the Internet from the freelancing websites. It is an open source language and is free to install and use. This is the main reason for the increase in the popularity of this language.

Bookmark and share this tutorial
Related Ads

Credit card counseling

You may have seen the commercials on TV "Freedom Debt Relief" and credit card counseling. These services allow helping you control your life to get back by offering credit card debt free reduction. In some cases they may even be able to repair your credit to some extent. In fact, the debt consolidation has become a 7 billion U.S. dollars a year industry, but how do you know that the debt / credit repair scam or legitimate business?

Ten years ago, the National Foundation for Credit Counseling and its affiliates in Consumer Credit Counseling Services Credit card counseling dominated the scene. She worked with the plan to repay creditors, debt settlement and to negotiate lower rates for those who slip behind. However, the increase in consumer debt prompted hundreds of start-ups were as savvy in the world of advertising if they were credit repair scams.

Some of the competitors, who were often called "debt settlement specialists," charged large upfront fees for multiple creditor’s mere pennies on the dollar. Often, people pay as much as $ 3000 off-the-bat to their accounts up to date, only to find that the colonists had no debt to repay their creditors at all! Finding a legitimate business, it is recommended that you verify their identity through the Better Business Bureau and the stick with one of the famous, non-profit organizations such as the NFCC and CCCS said and get out of debt.

In dealing with credit card counseling services, research the company before signing up. You needn't pay exorbitant advance for most legitimate businesses. Consumer Credit Counseling Services, for example, only costs a $ 10 set-up fee. If the company isn't joined the National Foundation for Credit Counseling or the Association of Independent Consumer Credit Counseling Agencies, may be a scam.

If you find yourself delayed or missed payments within the first month of service, then get out, because there may be money from your pocket. Also beware of false promises to your debts for little or no money to arrange. If you've missed several payments over a long period of time, then you're going to a low credit score for the next year or two. The information will remain on your record for seven years after the initial delinquency, so patience is needed to restore your credit.

"People faced with credit card debt is not their financial problems and can not be resolved so they are leaving," said Ben Woolsey, director of consumer research for the "Credit Card ". In a recent study 35% of cardholders who carry a balance on their credit cards and 15% said they've had some trouble making payments. Credit card counseling is a good way out of the cycle of denial and ignorance, Woolsey added. Many people would rather talk about something other than personal finance. A credit repair company debt or supervisor will put everything on the table, setting up an agenda and identify hotspots.

Bookmark and share this tutorial
Related Ads

Dot Net Questions: COM - DCOM - COM+

The dot net frameworks allow you to build serviced components that can use com+ services. These components of dot net framework runs in the manages execution environment of dot net framework that is share their content with com+ application.

Now the question arise what com+ and what is doing how is its comes in existence. Before com+ comes into existence. COM (Component Object Model) is first programming model that provide component based approach to software development. This component based approach of com allowed us to develop small, logical reusable and stand alone modules that integrates into a single application. But these components could not be display on over network.

So these drawback produce another model that is DCOM (distributes COM). DCOM programming model enabled you to display com components over network and distribute application easily across platforms. DCOM components also help in two-tier client/server applications. These models also have some drawback that helps to development of COM+ approach. What these drawbacks are…


These two-tier architecture helps us to sharing of resources and data but these approach have some drawbacks that are as follows.

The DCOM approach overburdened client computer with the responsibility of performing all processing functions while the server merely acted as traffic controller, helps movement of data to and from the client and server components. So availability of resources was therefore, always a problem and the performance of application suffered. Multiple request of data cause to network traffic. So performance of application decreases.

Dot Net Interview Questions - Dot Net FAQ

After all these Microsoft introduced windows DNA(Windows Distributed internet applications) architecture that overcomes the shortcoming of the two-tier system. The windows DNA helps us to develop three-tier application architecture which helps us to maintain the business logic and data access code in separate components that is business objects. These separate the client application from the business logic and data access code so no need of recompiling and redeveloping client application after change in code.


Know more about dot net questions and COM - DCOM.

Bookmark and share this tutorial
Related Ads

Basic ASP NET programming tips

ASP net programming is a web application developed by Microsoft. It is a powerful web application that allows programmers to build dynamic websites, web services and web applications.

There are two important things to note about ASP. It is not a programming language, but a technology that allows a web application development . The action involved in this technology takes place on the server and not the personal computer. When on a server, it can interpret different programming languages including JavaScript, PerlScript and VBScript. It is also possible to mix these languages on the same ASP web page framework in order to obtain better results.

In order to get started with it, you need a web server and a .NET framework. Make sure the web server supports the .NET framework. It can wither be Microsoft IIS (Internet Information Services) or an Apache 2 with mod_aspdotnet in it. Once the web server has bee set up, you need to consider the text editor you would use. Notepad on Windows or Emacs on Linux are good editor choices. Of late, Notepad ++ has been used extensively since it has enhanced features like syntax highlighting, enables FTP and an integrated word count function as well.


Here is the series of steps in creating a simple ASP.NET web page:
• Choose and define the language you want to use on the framework. Typically it is C# or VB.
• Next, create a HTML form.
• Ping this form to the server you want to use.
• Any processing on the server should be carried out.
• Return the necessary results to the client according to their requirements.


I am working as an asp net programmer in an
offshore web development company. ASP NET programming is one of my interests and I like to educate public about it through my articles.

Bookmark and share this tutorial
Related Ads

Why is 24/7 Customer Service Important?

One of the main things that I would recommend when it comes to look at your next/first cheap web hosting company is one that offers 24/7 customer support. You shouldn’t have a problem in finding a company that does offer this because many hosting companies recognize how important this is. The reason it is important is because of time differences Its all very well at signing up to a company that offer support 9am-5pm but if that’s for an American company that’s not going to be very helpful if your are in the UK. 9am in American can range from 1pm to around 5pm in England. If your web hosting is down or you need some support, its not going to be very helpful waiting until the afternoon before you can get some help. If your website is down then you are losing money as no one can get to your site. Also if a new person visits and your website isn’t working then the chances of them coming back are very slim, so you are affecting your future traffic too. For this reason you want a company that will be there to fix it, no matter the time of day!

Bookmark and share this tutorial
Related Ads

Dot Net Remoting In Dot Net Questions

Remoting helps in communication between two or more application. It does not matter whether it is on same computer or on different computers and it is also possible that both are using different operating system. The dot net remoting helps in number of services such as control on the lifetime of objects and also helps in transporting message in different objects using communication channels. Communication channels helps in transport message in between the remote objects.

When any messages are sent with communication channels are encoded and after this decoded with the help of dot net serialization formatters these are binary and soap. These are two kinds of encoding possible just like binary and xml encoding. Both of these have different users. Binary encoding helps full where performance is first requirement. Xml coding helps where interoperability is required.


Dot net remoting enables to perform communication between different object by using number of transportation protocols such as HTP and TCP/IP.

Dot net remoting system allows client to call objects in remoting boundaries. This boundary includes application domains, and processes in computer. To communicate between server objects and client objects we need to use object reference of server objects in client application in dot net Remoting. When we create a instance of remote objects using new keyword client get a reference to this server objects. After getting this reference client can call methods on server objects this object resides in client’s process not on different computer.

Dot net remoting proxy objects to allow the client process to get server objects. When we create instance of remoting objects dot net remoting creates a proxy object and send this to client application.


For more info on Dot Net Interview Questions and Dot Net Questions visit dotnetquestion.info

Bookmark and share this tutorial
Related Ads

The Java Programming Language

Java - an island of Indonesia, a type of coffee, and a programming language. Three very different meanings, each in varying degrees of importance. Most programmers, though, are interested in the Java programming language. In just a few short years (since late 1995), Java has taken the software community by storm. Its phenomenal success has made Java the fastest growing programming language ever. There's plenty of hype about Java, and what it can do. Many programmers, and end-users, are confused about exactly what it is, and what Java offers.
Java is a revolutionary language

The properties that make Java so attractive are present in other programming languages. Many languages are ideally suited for certain types of applications, even more so than Java. But Java brings all these properties together, in one language. This is a revolutionary jump forward for the software industry.


Let's look at some of the properties in more detail: -

*

object-oriented
*

portable
*

multi-threaded
*

automatic garbage collection
*

secure
*

network and "Internet" aware
*

simplicity and ease-of-use

Object-oriented

Many older languages, like C and Pascal, were procedural languages. Procedures (also called functions) were blocks of code that were part of a module or application. Procedures passed parameters (primitive data types like integers, characters, strings, and floating point numbers). Code was treated separately to data. You had to pass around data structures, and procedures could easily modify their contents. This was a source of problems, as parts of a program could have unforeseen effects in other parts. Tracking down which procedure was at fault wasted a great deal of time and effort, particularly with large programs.


In some procedural language, you could even obtain the memory location of a data structure. Armed with this location, you could read and write to the data at a later time, or accidentally overwrite the contents.

Java is an object-oriented language. An object-oriented language deals with objects. Objects contain both data (member variables) and code (methods). Each object belongs to a particular class, which is a blueprint describing the member variables and methods an object offers. In Java, almost every variable is an object of some type or another - even strings. Object-oriented programming requires a different way of thinking, but is a better way to design software than procedural programming.

There are many popular object-oriented languages available today. Some like Smalltalk and Java are designed from the beginning to be object-oriented. Others, like C++, are partially object-oriented, and partially procedural. In C++, you can still overwrite the contents of data structures and objects, causing the application to crash. Thankfully, Java prohibits direct access to memory contents, leading to a more robust system.
Portable

Most programming languages are designed for a specific operating system and processor architecture. When source code (the instructions that make up a program) are compiled, it is converted to machine code which can be executed only on one type of machine. This process produces native code, which is extremely fast.

Another type of language is one that is interpreted. Interpreted code is read by a software application (the interpreter), which performs the specified actions. Interpreted code often doesn't need to be compiled - it is translated as it is run. For this reason, interpreted code is quite slow, but often portable across different operating systems and processor architectures.

Java takes the best of both techniques. Java code is compiled into a platform-neutral machine code, which is called Java bytecode. A special type of interpreter, known as a Java Virtual Machine (JVM), reads the bytecode, and processes it. Figure One shows a disassembly of a small Java application. The bytecode, indicated by the arrow, is represented in text form here, but when compiled it is represented as bytes to conserve space.


Figure One - Bytecode disassembly for "HelloWorld"

The approach Java takes offers some big advantages over other interpreted languages. Firstly, the source code is protected from view and modification - only the bytecode needs to be made available to users. Secondly, security mechanisms can scan bytecode for signs of modification or harmful code, complimenting the other security mechanisms of Java. Most of all though, it means that Java code can be compiled once, and run on any machine and operating system combination that supports a Java Virtual Machine (JVM). Java can run on Unix, Windows, Macintosh, and even the Palm Pilot. Java can even run inside a web browser, or a web server. Being portable means that the application only has to be written once - and can then execute on a wider range of machines. This saves a lot of time, and money.
Multi-threaded

If you've ever written complex applications in C, or PERL, you'll probably have come across the concept of multiple processes before. An application can split itself into separate copies, which run concurrently. Each copy replicates code and data, resulting in increased memory consumption. Getting the copies to talk together can be complex, and frustrating. Creating each process involves a call to the operating system, which consumes extra CPU time as well.

A better model is to use multiple threads of execution, referred to as threads for short. Threads can share data and code, making it easier to share data between thread instances. They also use less memory and CPU overhead. Some languages, like C++, have support for threads, but they are complex to use. Java has support for multiple threads of execution built right into the language. Threads require a different way of thinking, but can be understood very quickly. Thread support in Java is very simple to use, and the use of threads in applications and applets is quite commonplace.
Automatic garbage collection

No, we're not talking about taking out the trash (though a computer that could literally do that would be kind of neat). The term garbage collection refers to the reclamation of unused memory space. When applications create objects, the JVM allocates memory space for their storage. When the object is no longer needed (no reference to the object exists), the memory space can be reclaimed for later use.

Languages like C++ force programmers to allocate and deallocate memory for data and objects manually. This adds extra complexity, but also causes another problem - memory leaks. When programmers forget to deallocate memory, the amount of free memory available is decreased. Programs that frequently create and destroy objects may eventually find that there is no memory left. In Java, the programmer is free from such worries, as the JVM will perform automatic garbage collection of objects.
Secure

Security is a big issue with Java. Since Java applets are downloaded remotely, and executed in a browser, security is of great concern. We wouldn't want applets reading our personal documents, deleting files, or causing mischief. At the API level, there are strong security restrictions on file and network access for applets, as well as support for digital signatures to verify the integrity of downloaded code. At the bytecode level, checks are made for obvious hacks, such as stack manipulation or invalid bytecode. The strong security mechanisms in Java help to protect against inadvertent or intentional security violations, but it is important to remember that no system is perfect. The weakest link in the chain is the Java Virtual Machine on which it is run - a JVM with known security weaknesses can be prone to attack. It is also worth noting that while there have been a few identified weaknesses in JVMs, they are rare, and usually fixed quickly.
Network and "Internet" aware

Java was designed to be "Internet" aware, and to support network programming. The Java API provides extensive network support, from sockets and IP addresses, to URLs and HTTP. It's extremely easy to write network applications in Java, and the code is completely portable between platforms. In languages like C/C++, the networking code must be re-written for different operating systems, and is usually more complex. The networking support of Java saves a lot of time, and effort.

Java also includes support for more exotic network programming, such as remote-method invocation (RMI), CORBA and Jini. These distributed systems technologies make Java an attractive choice for large distributed systems.
Simplicity and ease-of-use

Java draws its roots from the C++ language. C++ is widely used, and very popular. Yet it is regarded as a complex language, with features like multiple-inheritance, templates and pointers that are counter-productive. Java, on the other hand, is closer to a "pure" object-oriented language. Access to memory pointers is removed, and object-references are used instead. Support for multiple-inheritance has been removed, which lends itself to clearer and simpler class designs. The I/O and network library is very easy to use, and the Java API provides developers with lots of time-saving code (such as networking and data-structures). After using Java for awhile, most developers are reluctant to return to other languages, because of the simplicity and elegance of Java.

Bookmark and share this tutorial
Related Ads

Dot Net Programming: New Lease of Life with the Current Demand

If you're a keen .NET programmer, you are probably aware of what the above title says. Since the birth of multi-core computing, there has been a requirement for parallel-programming architecture. Now, the multi-core computing has developed into the prevailing paradigm in computer architecture since the invention of multi core-processors.
Incidentally, almost every programmer considers Visual Studio 2008 and .NET Framework 3.5 as getting distant and out of the way. To prevent its programming market fiasco, recently, Microsoft released the beta versions of .NET Framework 4 and Visual Studio 2010. The major focus fell on .NET 4, yet the labels boasted the arrival of parallel-programming. The question is whether there are any benefits particularly towards performance, on sticking to existing APIs? Go through to get the answer of the question.


.NET 4's Multi-Core processing ability:

Primarily, the MSDN site shows that the parallel extensions in the .NET 4, has been improvised itself to support analogous programming, targeting multi-core computing or distributed computing. The support for the Framework can be divided into four areas like library, LINQ, data structures and diagnostic tools. .NET 4's peers and predecessors are devoid of the multi-core operable ability.
The main criteria like communication and synchronization of sub-tasks were considered as the biggest obstacles in getting a good parallel program performance; But .NET 4's promising parallel library technology enables developers to define simultaneous, asynchronous tasks without having to work with threads, locks, or the thread pool.

Full support for multiple programming languages and compilers:
Apart from VB & C# languages, .NET 4 offers a full support for programming languages like Ironpython, Ironruby, F# and other similar .NET compilers. Other than the 3.5 version of the same model, it encompasses both functional-programming and crucial object-oriented programming.

Dynamic language runtime:

Addition of the dynamic language runtime (DLR) is a blessing for the .NET beginners. Using this new DLR runtime environment, developers can insert a set of services for dynamic languages to the CLR. Apart from that, the DLR makes it simpler to develop dynamic languages and to add dynamic features to statically typed languages. An original System Dynamic name space has been supplemented to the .NET Framework on supporting the DLR and numerous new classes supporting the .NET Framework infrastructure are extra to the System Runtime Compiler Services. Nevertheless, the new DLR provides the following advantages to developers: Developers can use speedy feedback loop which lets them enter diverse statements and execute them to see the results nearly immediately.


It has the ability to support for the top-down and more traditional bottom-up development. You can take the example of a developer using top down approach. He has the ability for call-out functions that are not yet can implement and then add them when required. There are simple refactoring and code modifications in which the Dot Net Programmers do not require to change static type declarations throughout the code.

Bookmark and share this tutorial
Related Ads

Importance of .Net Software Development

In the world of computers, software plays very important role just as hardware. This was recognized by Microsoft in earlier stages. Looking for new ways to improve their software, Microsoft made its software efficient not only to users but to developers as well.

.Net architecture not only helps businesses to make their existing software assets powerful but also to add new software services making them more productive. It can also prove effective in reducing application complexity and the related costs of developing and maintaining software.

.Net application development has helped to simplify development and customize of various enterprise level applications. This product comes as a part of Microsoft's Windows Operating System. .Net framework comes bundled with a lot of advantages, which makes it a widely used tool for .Net application development.



The .Net is built on the following Internet standards:

• UDDI, standard to search and discover Web Services

• XML, format for exchanging data between Internet Applications

• HTTP, communication protocol between Internet Applications

• SOAP, standard format for requesting Web Services


Advantages of .Net Software Development Services:

• Easy integration of any software into the Internet

• Supports directory services that can answer XML based questions

• Permits a wide variety of Internet devices to access data and applications

• Supports different levels of authentication of services such as passwords, wallets, and smart cards

• Ability to track visitors and report on the most requested web pages



The .Net framework is a set of huge library that encompasses various programming needs like user interface design, web development, data access, database connections, networking among many other algorithms. Hence the advent of .Net programming has simplified and made .Net application development very extensive.


Let's look at some important features of .Net framework:

• No language dependency
• Enhanced Security
• Easy deployment
• Easy Portability
• Interoperability


Commercial .Net Services that can be provided to Businesses:

• .Net Software Product Development

• .Net Desktop and Web Application Development

• Web Services based .Net Application development

• .Net custom control development


• .Net system design and application development

• .Net Architecture and design evaluation

• Developing web services using the .Net framework and the SOAP toolkit

• Migrating web and desktop applications to .Net

• Migration of application from .Net


.Net helps to develop your business, by generating large volumes of data that contain valuable information like individual facts about their customers, products, operations and people. By using .Net technology, web software outsourcing helps your business to do better.

Jane Bush invites you to gain more information on .net software development services at http://www.e-zest.net/dotnet.html

Bookmark and share this tutorial
Related Ads

Introduction to Microsoft .NET Technology

In 2000, Microsoft announced its .NET software environment, a new addition to Windows. The .NET ("dot - net") environment is effectively a "virtual computer" that runs on a real computer, with the advantage that any program written for it will run on any computer which is running .NET.
One important aspect of the .NET strategy is its independence from a specific language or platform. Developers can create a .NET application in any .NET - compatible language and participate in the same software project writing code in the .NET languages in which they are most competent (such as Visual C++.NET, Visual Basic .NET, C#, Perl and others). Part of the .NET software environment includes Active Server Pages (ASP) .NET technology, which allows developers to develop applications for the Web.


The .Net architecture can exist on multiple platforms, further extending the portability of .NET programs. Additionally, the .NET software environment involves a new program development process that could change the way programs are written and executed, leading to increased productivity.

The most important component of the .NET architecture is Web Services, which are applications that can be used over the Internet. One example of a Web service is the tour operator's flights booking system. The tour operator wanted to enable customers to book flights from the tour operator's Web site. To do so, the tour operator needed to access the airline's booking system. In response, an airline partner created a Web service that allowed the tour operator to access the airline's database and make bookings. Web services enable the two companies to communicate over the Web, even if they use the different operating systems (the tour operator uses UNIX and the airline uses Windows). By creating a Web service, the airline can allow other tour operators to use its booking system without creating a new program.


The .NET strategy extends the concept of software reuse to the Internet, allowing developers to concentrate on their specialties without having to implement every component of every application. Instead, companies can buy Web services and devote their time and energy to developing their products.

The .NET strategy incorporates the idea of software reuse. When companies link their products in this way, a new user experience emerges. For example, an online store could buy Web services for online credit-card payments, user authentication and inventory databases to create an e-commerce Web site. The keys to this interaction are XML and SOAP, which enable Web service to communicate. XML gives meaning to data, and SOAP is the protocol that allows Web services to communicate easily with one another. XML and SOAP act together combining various Web services to form applications.


Another important concept in the .NET technology is universal data access. If two copies of a file exist (such as on a personal computer and a company computer), the less recent version must constantly be updated, this is called file synchronization. If the separate versions of the file are different, they are unsynchronized and could lead to serious error. Using the .NET data could reside in one central location rather than on separate systems. Any internet-connected device could access the data, which would then be formatted properly for use on access device (a desktop PC, a PDA or other device). Thus, the same document could be displayed and edited without the need to synchronise the data, because it would be up to date in central area.

Bookmark and share this tutorial
Related Ads

MICROSOFT DOT NET

The .NET Data Types

The .NET data types are the types you use to store your data. They are value types and can be broken down into subcategories: Integer types, Floating-point types, the Boolean type, and the Char type. Two built-in reference types that are an integral part of your application will also be discussed: the String type and the Object type.
Integer Types

The .NET Framework provides a variety of Integer types. Table 3.1 summarizes these types and lists their corresponding Microsoft Visual Basic .NET and Microsoft Visual C# types.

The System.Single type is appropriate for floating-point calculations that require a lower degree of precision. It provides seven significant digits of precision. For greater levels of precision, you can use the System.Double type. This provides a much greater level of precision as well as the ability to handle vastly larger values. The System.Decimal type is specifically designed to facilitate financial calculations and is an ultra-high precision variable. Although it cannot hold values as great as System.Double, it has a much higher level of precision, providing 28 significant digits.

Non-Numeric Types

Four additional types that do not represent numbers are discussed in this section: System.Boolean, System.Char, System.String, and System.Object.
System.Boolean

The System.Boolean type is used to represent a value that is either true or false. It is called Boolean in Visual Basic .NET, and bool in Visual C#. The values that are valid for Boolean variables are True and False (Visual Basic .NET) or true and false (Visual C#).
System.Char

The System.Char type represents a single instance of a 16-bit Unicode character. It is called char in Visual C# and Char in Visual Basic .NET.
System.String

The System.String type is a reference type, and it represents a series of Char data types. In everyday terms, a string can represent a word, a paragraph, a key value, or any other string of characters. In Visual Basic .NET this type is called String, and in Visual C# it is called string.

System.Object

The Object type is the supertype of all types in the .NET Framework. Every type, whether value type or reference type, derives from System.Object. In Visual Basic .NET it is called Object, and in Visual C# it is called object.

If an object of a particular type is stored in an Object variable, it must be explicitly converted back to that type to access any of its inherent functionality.
Converting Types

At times, you will need to convert data from one type to another. Data can be converted in two ways: implicitly, which means the conversion is performed automatically, and explicitly, which means you must specifically ask for the conversion to be performed.
Implicit Conversions

Implicit conversions between types are automatically performed whenever the conversion can be performed without the loss of data.

Using Data Type Functionality

All of the data types have some kind of built-in functionality. At the very least, they all support four methods:

* Equals. Determines whether two instances are equal
* GetHashCode. Serves as a hash function for a particular type
* GetType. Returns the type object for the current instance
* ToString. Returns a human-readable form of the object


Boxing

The secret is called boxing. Boxing is the implicit conversion of value types to reference types. All classes and types derive from Object, and each of these four methods is a method of the Object class. Because each class derives from Object, they can be implicitly converted to that type. When you call one of these methods, the run time creates a temporary reference for your stack and allows you to treat it as a reference type.

Unboxing is the conversion of a boxed variable back to a value type. To unbox a variable, you must perform an explicit cast on the object to convert it to the appropriate type. Only objects that have been boxed can be unboxed.
Data Type Member Methods

Data types also have other methods that do not derive from Object. These methods usually involve functionality specific to the type. In Chapter 2, you were introduced to some of the comparison functions of the Char data type. Although the sheer scope of these methods is too great to be adequately dealt with in this text, some of the more generally useful functions will be discussed.
Parse

All of the value data types implement a Parse method. Parse is used to create a numeric value from a string. The Parse method is extremely useful when developing user interfaces. Controls that accept user input, such as TextBox, do so in the form of a string. The Parse method can be used to convert that string to usable data. Note that if a string cannot be read as a numeric value, an error will result. In all implementations, Parse is a static (Shared) method, and must be called from the type object rather than from an instance.
To convert a string to a numeric data type

Call the Parse method of that data type on that method.
The complete article and further complete information can he found at

http://dotnetpoint.blogspot.com

Bookmark and share this tutorial
Related Ads

28 tips for ASP.NET programming

1) Go for Javascript validations instead of validation controls
2) Use Javascript instead of VBscript.
3) Minimize the use of Forms authentication.
4) Use Connection Pooling and Object Pooling
5) Turn off Tracing unless until required
6) Turn off Session State, if not required
7) Disable View State of a Page if possible
8) Set debug=false in web.config
9) Avoid Response.Redirect as many places
10) Use the String builder to concatenate string
11) Avoid throwing exceptions. try to handle the exceptions without try catch.
12) Use Finally Method to kill resources
13) Avoid unnecessary round trips to the server
14) Use Gzip Compression
15) Use Page Output Caching and Proxy Servers
16) Use Per-Request Caching
17) Use Page.ISPostBack
18) Avoid Unnecessary Indirection
19) Use "ArrayLists" in place of arrays
20) Place StyleSheets into the Header
21) Put Scripts to the end of Document
22) Make JavaScript and CSS External
23) Use DataReader instead of Dataset
24) Make Enableviewstate property as false for the components (particularly for heavy items like datagrid, datalist etc) if it is not necessary.
25) Use xmlhttprequest object or scriptmanager to minimize post backs.
26) Declare regions for each section of codes.
27) Try to use datarepeater than any other data controls.
28) Use skins files.

Bookmark and share this tutorial
Related Ads

Tutorial 8: Error Handling

Reason of this project:
Error handling is one of the most difficult thing that may afford a programmer. It isn't as easy as you think and handling errors in a program some time can make errors occur!

Project details:
1- New solution for handling errors in .net
2- Try...Catch...Finally Block
3- Error handling sample


1- New solution for handling errors in .net

Errors handling had been improved with the new .net. The Try...End try block can minimize code and simplify it.
However some old methods still alive with the .net 2.0 which can be useful sometimes.
There's also some changes that we'll discuss.
From the first Visual Basic edition and also I remember it on QBasic, there was a method to handle errors which is "On Error".
Now the method still exist but replace with the new Try...End try block.
In error raising we'll use the Throw command.

2- Try...Catch...Finally Block

The Try...Catch...Finally Block structure

Try
Here's the code where you want to monitor for errors

Catch
When an error occurs, the application will jump immediately to this section.

Finally
This step is optional, but if defined it'll run whatever an error occur or not.
Generally we use it to close an opened file or connection

There can be different types of errors.
This structure allows you to handle each type alone.



Try
' ----- The Code is here.
Catch ex As System.OutOfMemoryException
' ----- Handle memory errors here.
Catch ex As System.Exception
'
----- Handle all other errors here.
End Try

You can do more customization for the Catch block and this shows how much the .net is flexible.
Let understand how this was done.
The integer is empty when we start running the code. Now we go to step 1, the integer contain 1. If an error occur, the application will stop processing and jump to the Catch blocks. Each block to choose? ;)



Dim Step as integer
Try
' ----- The Code is here.
Step = 1
....
Step = 2
....
Catch ex As Exception When Step = 1
' ----- Handle
the step 1 errors
Catch ex As Exception When Step = 2
' ----- Handle the
step 2 errors
End Try

3- Error handling sample

The sample is simple!
There's two text boxes, you have to fill both of them with numbers. By pressing the button you'll divide them.
When the problem can occur?


Dim a As Integer = CInt(TextBox1.Text) 'Here when converting
Dim b As
Integer = CInt(TextBox2.Text) 'Here when converting
TextBox3.Text = a / b
'When dividing by Zero or big numbers (out of capacities)

How to handle those errors?
Check out the sample to know how we can do it. The sample is commented and explanation is inside.


Subscribe to get the latest tutorials
Download the tutorial


The Zip file contains:
-The sample source code
-The readme.txt file
-The tutorial.txt file

Still have question:
Post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.


Bookmark and share this tutorial
Related Ads

Tutorial 7: Interaction Commands and Functions

Reason of this project:
The Microsoft.VisualBasic.Interaction class exposes many useful commands and methods that were available in Visual Basic like AppActivate, Beep, Callbyname...
This tutorial shows how to work with some of them.
Project details:
1- From VB 6.0 to VB .net 2.0
2- Useful interaction commands
3- Samples of interaction commands

1- From VB 6.0 to VB .net 2.0

There was several changes on VB .net (it's a big change and that's clear). Although in an effort to make the transition from VB 6 to VB 2005 as easy as possible, Microsoft has gathered most of the Visual Basic 6.0 commands and functions in the Microsoft.VisualBasic.dll assembly.
Some of the commands and functions was deleted, other still the same and others changed to the .net syntax.
For Example:
VbCrlf which is used on VB 6.0 (as a separator) still alive on VB .net 2.0 but a new syntax is already available for use.
ControlChars.crlf is the new method
As you are using VB .net I recommend that use the new syntax, and I'm going to introduce some of the important change between the old and the new syntax.

2- Useful interaction commands

VB 6.0 syntax contain many useful interaction commands and function like the Message Box for example. Those commands still alive but have been improved in the .net 2.0 version.

Shell Function:
The shell function runs an executable program, it works like the command line so you can use it as a command line.
The shell function is capable of returning an integer indicating if the program still running or not. The shell function was expanded in the .net 2.0 version and supports an additional argument that enables you to specify whether to wait until the shelled program terminates with an optional timeout.
Use of the function
Shell (Application Path, Style, Wait, Timeout)

Example:
' Run Notepad.exe and wait until the user terminates it.
Shell ("notepad", AppWinStyle.NormalFocus, True)


AppActivate Function:
AppActivate is a cool function that may be helpful if you are developing application for Windows. Now let see how this works and what it do. The AppActivate function as it names, activate a currently running application.
How it activates? Simply by giving the focus to the application Window.
The function is quite useful and require only to know the windows caption!
Use of the function
AppActivate ( Title) or AppActivate (ProcessID)

NB: You have to choose either to use the title or the processID and not both!

Now let's see this example
' Activate the NotePad Window
AppActivate("Untitled - Notepad")

Now as we know those simple functions we can use them to build helpful projects and application. Now see the sample of the interaction commands.

3- Samples of interaction commands

This sample is exactly a direct (little expanded) application of the two functions that we have studied together right now.
There's only one sample and if you run it you'll get a window with 2 buttons.
Each button introduce a sample for each function. The button caption let you distinguish them.

The Shell sample:
Run a notepad application and return a message if the NotePad was closed.
If the timeout was exceeded (5 seconds), return a message that the NotePad still running
The AppActivate:
The following sample run a notepad with no focus and use AppActivate to give it the focus.
So the sample use both of the functions

Download the source code

The Zip file contains:
-The sample source code
-The readme.txt file
-The tutorial.txt file

Still have question:
Go to our blog (http://thedotnetsource.blogspot.com). Select the tutorial post. Post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Reason of this project:
This is the next part of the previous tutorial. We'll learn here how to add, change, read, delete registry keys and values using vb.net.
I included a sample that contains all those functionality.
Project details:
1- How to add a registry key/value
2- How to read a registry value
3- How to delete a key or a value
4- Changing a value or a key
5- Hints to use registry with VB.net
6- The registry reader (VB.net)

1- How to add a registry key/value

One thing that I think I forget to notice. A folder in the registry is name "key" and the elements in this key are named "values".
There's a description of each value type in the 5th tutorial
Now we'll see how to add a key or a value.
Probably you have thought where we'll put it and whether it's a key or a value.
So we have 2 things to notice.
Visual Basic will automatically show you the hives (they are stored in).
You'll have only to choose the needed one.
To do that paste the following line.
My.Computer.Registry.CurrentUser.CreateSubKey("TestKey")

This line will create a key in the HKEY_CURRENT_USER hive and will be named "testkey"
Now let's move on to see how to set a value.
For the value we'll need three things: Value path, Value name and value value. We can also precise the value type if not Visual Basic will try to assign the value type depending on the object type.
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\TestKey", "TestValue", "This is a test value.")

Tip: Type "," and Visual Basic will show a list of value types.

The sample:
The sample contain two part, one for creating keys and the other to create values.
To create a key just put the named of the key and it'll be created in the Current_User folder.
To assign a value, type the complete path, for example "HKEY_CURRENT_USER\mykey" and then the value name then the value content and click add to create it.

2- How to read a registry value

The next thing is to read what we wrote!
This is so simple, just put the following line.
You'll need to have the Path and the name of the value.
Dim readValue As String
readValue = My.Computer.Registry.GetValue _
("HKEY_CURRENT_USER\TestKey", "TestValue", Nothing)
MsgBox("The value is " & readValue)

If you wish to do more complex things, like getting the keys in a hive and getting the values of keys...
Then you should see the registry viewer sample. (Download the source code to get it)

3- How to delete a registry key or value

We finish by deleting what we added.
To do this it's easy!
The following line will delete a key
My.Computer.Registry.CurrentUser.DeleteSubKey("TestKey")

To delete a value
my.Computer .Registry .CurrentUser.DeleteValue("Test value")


4- Changing a value or a key

Changing a value can be somewhat difficult.
Dim autoshell = My.Computer.Registry.LocalMachine.OpenSubKey("Software\Microsoft\Windows NT\CurrentVersion\Winlogon", True)
'' Set the value to 0
autoshell.SetValue("autorestartshell", 0)
autoshell.Close()
After opening a subkey (don't forget true! as it give you permission to delete), we can use the autoshell in order to change any value in the following subkey.

5- Hints to use registry with VB.net

We can count the values in a hive
My.Computer.Registry.CurrentUser.ValueCount.ToString()

But also the keys
My.Computer.Registry.CurrentUser.SubKeyCount.ToString()

And check if a value exist
If My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\MyKey", _
"TestValue", Nothing) Is Nothing Then
MsgBox("Value does not exist.")
Else
MsgBox("Value exist.")
End If

6- The registry reader (VB.net)

I have included an application with the source code. This one will resume all what we have done.
It's like the registry editor of Windows but still view only and can't edit values.

Download the source code

The Zip file contains:
-The sample source code
-The registry viewer application
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Tutorial 5: What is Windows registry (Registry Keys)

Reason of this project:
I wrote this tutorial in order to help the hundred of programmers searching on the web for Windows registry.
This is an like introduction, if you are seeking how to use and deploy the registry keys with Vb.net, just see the next tutorial (It'll be tutorial 6).
In this tutorial I'll show what is the windows registry system and why use it.

Project details:
1- What is Windows registry and why use it
2- How to read, write and change the registry
3- HIVES and their use
4- Definition of registry values

1- What is Windows registry and why use it.

You can compare the Windows registry to a database. It stores informations related to Windows and other installed application on your system, but also Hardware.
Think now if someone need to change the computer name via programming. How can he do this?
Programmers can think of files (text files) to store the computer and windows information. But when file get big and heavy, Database will be more secure. And then they had (Windows builder) the choice of a database "Windows Registry".
Microsoft Dot Net Frame 1.1 and higher have implemented a great solution for registry on their classes. This will replace the hard work and long lines of code that programmers have to write if they are using Visual Studio 6.0 for example.

2- How to read, write and change the registry

Windows has a wonderful tool on it, named "Registry Editor". But you won't find it, unless you open the System32 folder on the Windows folder.
But we can easily run it through the execute command it the start menu. Just type "regedit" (without quotes).
Now the registry editor will open.
Please before doing any changes on your registry make a backup.
To do a windows registry backup: File > Export > Give a name for the file and select the All option box.
The backup may block your pc from working for a short period of time.
You'll see that there are 5 folder. Those are the main folder (named hives) and you can't add another main folder.
Now you can select any folder and right click on it, then add a new sub-folder or value.
By selecting any folder and right clicking, you'll find a list of action that you can do.
If the action is blended (made not selectable), then either it's impossible or you don't have the rights to do this action.
You need administrator rights to change registry keys.

3- HIVES (main registry folders) and their use

The registry is split into a number of logical sections named "hives", those are the top main folder that can added, edited or renamed.
They all start with "HKEY" prefix.

HKEY_CLASSES_ROOT
Stores information about registered applications, such as Associations from File Extensions and OLE Object Class ID's tying them to the applications used to handle these items.
HKEY_CURRENT_USER
Stores settings that are specific to the currently logged-in user. The HKCU key is a link to the subkey of HKEY_USERS that corresponds to the user; the same information is reflected in both locations. On Windows-NT based systems, each users' settings are stored in their own files called NTUSER.DAT and USRCLASS.DAT inside their own documents and settings subfolder.
HKEY_LOCAL_MACHINE
Stores settings that are general to all users on the computer. On NT-based versions of Windows, HKLM contains four subkeys, SAM, SECURITY, SOFTWARE and SYSTEM, that are found within their respective files located in the %SystemRoot%\System32\Config folder. A fifth subkey, HARDWARE, is volatile and is created dynamically, and as such is not stored in a file. Information about system hardware drivers and services are located under the SYSTEM subkey, whilst the SOFTWARE subkey contains software and windows settings.
HKEY_USERS
Contains subkeys corresponding to the HKEY_CURRENT_USER keys for each user registered on the machine.
HKEY_CURRENT_CONFIG
Contains information gathered at runtime; information stored in this key is not permanently stored on disk, but rather regenerated at boot time.

4- Definition of registry values

Binary Value
REG_BINARY
Raw binary data. Most hardware component information is stored as binary data and is displayed in Registry Editor in hexadecimal format.
DWORD Value
REG_DWORD
Data represented by a number that is 4 bytes long (a 32-bit integer). Many parameters for device drivers and services are this type and are displayed in Registry Editor in binary, hexadecimal, or decimal format. Related values are DWORD_LITTLE_ENDIAN (least significant byte is at the lowest address) and REG_DWORD_BIG_ENDIAN (least significant byte is at the highest address).
Expandable String Value
REG_EXPAND_SZ
A variable-length data string. This data type includes variables that are resolved when a program or service uses the data.
Multi-String Value
REG_MULTI_SZ
A multiple string. Values that contain lists or multiple values in a form that people can read are generally this type. Entries are separated by spaces, commas, or other marks.
String Value
REG_SZ
A fixed-length text string.
Binary Value
REG_RESOURCE_LIST
A series of nested arrays that is designed to store a resource list that is used by a hardware device driver or one of the physical devices it controls. This data is detected and written in the \ResourceMap tree by the system and is displayed in Registry Editor in hexadecimal format as a Binary Value.
Binary Value
REG_RESOURCE_REQUIREMENTS_LIST
A series of nested arrays that is designed to store a device driver's list of possible hardware resources the driver or one of the physical devices it controls can use. The system writes a subset of this list in the \ResourceMap tree. This data is detected by the system and is displayed in Registry Editor in hexadecimal format as a Binary Value.
Binary Value
REG_FULL_RESOURCE_DESCRIPTOR
A series of nested arrays that is designed to store a resource list that is used by a physical hardware device. This data is detected and written in the \HardwareDescription tree by the system and is displayed in Registry Editor in hexadecimal format as a Binary Value.
None
REG_NONE
Data without any particular type. This data is written to the registry by the system or applications and is displayed in Registry Editor in hexadecimal format as a Binary Value
Link
REG_LINK
A Unicode string naming a symbolic link.
QWORD Value
REG_QWORD
Data represented by a number that is a 64-bit integer. This data is displayed in Registry Editor as a Binary Value and was introduced in Windows 2000.

This tutorial doesn't contain any source.
Download the tutorial

The Zip file contains:
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Tutorial 4: Avoiding the Timer Control

Reason of this project:
I have done a long search on this theme. I have already published 2 tutorials on how to use timer.
Now I found a method with vb.net on how to count without using the timer control.
This can be helpful if you are using a Command Line Application

Project details:
1- How this work?
2- A small sample
3- The stopwatch class

1- How this work?

It works exactly like the timer work! The stopwatch is a class that can help you count.
To declare this class use this line of code:
Imports System.Diagnostics.Stopwatch
This line must be left in the top of the code before anything.
I'll introduce in the 2d sample how to use the stop watch class.
However in the next sample, I'll show a simple method to avoid using the timer control and the Stopwatch also.


2- A small sample

Our aim here is to calculate the time elapsed between 2 different steps in the program.
This task seems to be complex and need a timer. But we'll do it without a timer in a very simple method.
How this is done?
The Now.tick return a time (don't matter what it return), however this time change regularly. (It's a real counter).
Between the two steps we'll calculate the difference and divide it by 10,000,000. (Because Tick precision is Nano-second!!).
This is the code so far:
Dim First As Long
Dim second As Long
Dim time As Double
First = Now.Ticks
MsgBox("OK to see counted time")
second = Now.Ticks
time = (second - First) / 10000000
MsgBox("Time in seconds: " & time.ToString())

See the sample for more information (Commented)


3- The stop watch

The previous method is helpful but can be limited to work with.
The stop watch will solve the problem. It's a class that exist in the .net Frame Work.
To declare this class use this line of code:
Imports System.Diagnostics.Stopwatch
This line must be left in the top of the code before anything.
I have already mentioned this, but although people don't see it and then have a problem when trying to run their application.
If you don't import the class you can't work with it!
What's the stopwatch class? It's a stopwatch!
How it works? exactly like the timer control, we can say that it's a timer control.
This is the line that will create a new stopwatch
Dim mystopwatch As New System.Diagnostics.Stopwatch

We'll start counting with the following line.
mystopwatch.Start()

And we'll get the elapsed time with
mystopwatch.Elapsed.Totalseconds

You can see the source code in the 2nd sample for more details.


Download Source Code

The Zip file contains:
-The two example source code
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Tutorial 3: Introduction for SQL Server

Reason of this project:
If you are a beginner in the domain of Data Base then you may don't know what's SQL Server. SQL server is good for data base management and will make your applications save much time.
In this tutorial that doesn't include any sample, we'll learn how to install and prepare MS SQL server; I'll post sample tutorials in later time.


Project details:
1- Introduction to SQL Server 2005
2- Installation of SQL Server 2005
3- Getting started with SQL Server 2005

1- Introduction to SQL Server 2005

I think you have an idea about Data bases (even about MS Access). A data base is a group of tables. Each tables posses some content and text on it. We'll see in later tutorials that we can include images and any file format.
The Database group the data and the server help us manage those data. With the server, we can add record, delete, drop tables. We can also do queries, for example searching for special text in the database..
An example of the power of the database:
This example will show you the obvious difference that makes a server and a database.
If you make a search for example using Windows Search (not in Vista because in Vista it indexes files), and suppose that you have 100,000 files to search.
The computer will spend about 15 minutes crawling your disk and may block!
Now let's make a search with Google or Yahoo. It find the words that you are searching in less than 1 second. However it searches in billions of pages!
How this can be done? Simply those search engines are using a database.
So you see the benefits of a database.
However if you want to use SQL Server, then you need to install it on the machine where you want your application to use the database.
luckily Microsoft offer MS SQL Server Express edition for free, so your clients can install it on their machines.
This is a common and very asked question: What's the difference between Access and SQL?
Access is a database but not a server; SQL is a server, it's role is to group all the databases and to manage them.
This is what make SQL more customizable and faster. It also have many other advantages.
SQL Server can also be used on Web application!

2- Installation of SQL Server 2005

We need to install SQL Server in order to use it; SQL server is like the sea, you can't take control of all its functionalities and tools. But Don't worry, me also I don't know all SQL Server tools and settings.
This is not a problem. But if you want to become a professional I think, you must take some special lessons about it. You'll need also a long time to become professional. But this tutorial can be an introduction.
Ok first we need to prepare the computer.
We'll install the express edition that is free. You can download it from the Microsoft site.
You'll need a 1 GHZ processor (at least 600 MHZ) and 1 GB memory.
More the computer is fast, more SQL become fast. If you'll manipulate small data SQL won't be slow; but it's first starting or use may take some time (when you connect for the first time).
After downloading SQL Server (about 50 Mb), execute the installation process.
The setup will analyze your computer, this may take some time and then we'll give you the report.
You may find warnings, read out the messages. It's better to have all the item green (success).
Then press next to continue the setup.
The SQL server should be installed

3- Getting started with SQL Server 2005

Now you should have SQL Server 2005 installed, I recommend also that you download the Microsoft Online documentation about SQL Server as it includes many important and basic things.
Now we are going to focus on the most important part of this server.
So select Start > All programs > SQL Server 2005 > Configuration tools.
Here you'll find the main SQL server applications.
We'll see only the "SQL Server Configuration manager" tool.
This tools we'll allow us to stop and start the SQL servers.
Click over SQL server 2005 services to see the installed servers on your Pc.
It contains very important information and excellent tutorials.
You may need to change those properties (of each SQL Server) in future when using SQL with VB.net.
Now if you want to install a new server then do it with the installation package.
There's other important things that I'm going to notice now.
Sometimes users complain that SQL server doesn't work on a network.
This is normal as you have this setting disabled by default.
To enable it and other settings, go to Protocols for YOURSERVERNAME and enable what you need.

Note: There's no source code for this tutorial
Download this tutorial

The Zip file contains:
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Reason of this project:
I have already explained well how to use the timer control. Now we'll try to use it in a complex (but not a lot) string problem.
The aim is to create an animation program, that reads text and make an animation by displaying the first, then the second...characters until it get the last one, then it make it again.
The speed can be also fixed. Also we'll added other settings like Mirror and Uppercase

Project details:
1- Description of the string class
2- First Step: Making a handler
3- Next Step: Making a clear plan
4- The alarm example

1- Description of the String Class:

I have explained the Timer control, you can see it just in the previous post; now I want to highlight about the String Class.
The String Class in Dot Net is different that the version 6.0 of Visual Studio. First it becomes an object, second some new features are available.
I'll highlight one: The Upper and the lower function.
This function will up case all the characters in the string or lower them.
Those function exist in VS 6.0 but I'm highlighting because we'll use them on our application.
String.length (function): return the string length as integer
String.substring (function): Retrieve a part from the string. You specify the starting and the length of this part.
Notes for integers:
n = n + 1 is the same as n += 1
n = n - 1 is the same as n -= 1
At end the string class isn't so complex or hard to use!

2- First Step: Sample aim and controls

Let's see what we need and what we won't.
The application must contain:

* A text box for the speed of the animation
* A text box for the text of the animation
* A button to start the timer
* A button to stop it (but we can also make them one button)
* A check box for Uppercase
* A check box for the mirror

Now let see what the application does.
The user type a text and set a speed. Then click Run to start the animation.
The user can choose Uppercase to make the printing results upper or to make them normal by unchecking.
If the user choose the mirror setting and the animation is running, it will stop it in order to reset the settings.
Note:
You can get many errors in this application for example if you enter a string and not an integer in the speed text box.
In this case you must use the Try Catch End Try block in order to get exceptions.
I didn't take care for this part as it isn't the subject of our work.

3- Next Step: Making a clear plan

The problem of most beginners programmers is where to start from?
They have learn a lot but they didn't know how to use their knowledge.
I'll show you how to create this project your self!
Me also I can't make such as project from the first hit (instance I mean).
I need to make parts and easier the project. I'll explain: Those are the parts that I have made before finishing my sample.

- Making an animation with a string (not variable). The project contain only a Label to show the animation. This is the most difficult part in the project and it took about 5 minutes.
- Adding the Run, Stop buttons (1 minute)
- Making the speed and the text customizable by the user (1 minute)
- Adding the Upper case check box (1 minute)
- Adding the mirror check box (2 minutes)
- Review of the project (1 minute)
- Adding comments to the code(3 minutes)

--> Total time: about 15 minutes.

It took a long time to make it! But it was finally made, because I divided my work on steps, from easier to harder and every time I make it a little bit harder.
But If you want to make it from the first time, you'll probably have errors and missed things on your application (else you are a genius).
Even with most easy case, this method is good; you learn how to organize your work.
If you are a beginner don't try to start from the last tutorial but from the first one because I'm increasing difficulty level each time.


4- Final Step: The first step

As I said in the project plan, this is the most difficult step ever.
I'll explain here only the first step, the rest you can easily understand it from the sample comment.
The aim is to have an animation that get from the first character to the last character with the help of the timer that make a time for a loop.
This is the most difficult sentence. It group all the needs; (From the first chr to the last chr) The first is always 0 and the last is always string.length.
We have only to add 1 each time the timer call the event. Plus if the n times arrived (equal) the length of the string we must reset it to 0 or stop the timer so the error don't occur.
How to get the text from the first to the last character:
result = anim.Substring(0, n)

We have to add 1 to n every time the timer call the procedure.
n += 1
If n = ln Then n = 0

But also to reset it!
See the source code for more information (read the comments).
Note: for the mirror, we'll make like we have done in the normal case but to inverse!
result = anim.Substring(n2, n)

n2 is the length (we start from the end) and decrease by 1 each time the procedure is called.

Download the source code

The Zip file contains:
-The example source code
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads

Tutorial 1: The timer control and stop watch application

Reason of this project:
Many of beginners’ programmers don’t know the timer control or how to use it to fit their needs.
For this reason, I came with this tutorial to show what the timer control is and how to use it on our application.

Project details:
1- Description of the timer control
2- The timer example
3- The speed watch example
4- The alarm example

1- Description of the timer control:


The timer control isn’t a timer and don’t show time. We use to create timer and speed watch.
How it function?
Simply, the timer control counts a period of time and then does an event.
  • You set an interval for the timer (for example 1 second)
  • You start the timer
  • The timer start counting
  • 1 Second: The timer calls an event (that you have declared)
  • The event does an action

--> And the timer loop (every 1 second).

We can say that the timer is a regular loop that does an event every interval of time that you set.

If you ask Visual Studio to get the MSDN help it'll shows:
The length of the intervals is defined by the Interval property, whose value is in milliseconds.
When the component is enabled, the Tick event is raised every interval.
This is where you would add code to be executed.
For more information, see How to: Run Procedures at Set Intervals with the Windows Forms Timer Component.
The key methods of the Timer component are Start and Stop, which turn the timer on and off.
When the timer is switched off, it resets; there is no way to pause a Timer component.

Many don't understand the MSDN help this is because you lack experience. The MSDN documentation thinks that you know every thing!
But I'll explain on an easy way how to use it and understand all this text.
To understand we'll do the first sample together, I'll explain as much as possible.
For the 2 other samples just read the comments associated to the code source.

2- The timer example


In this example we’ll create a clock that shows time. I know that every one can use the following expression: Date.now and get the time.
But now we won’t to update it, I mean every 1 second the clock refresh and show the time again.
If we use a loop this we’ll take much time of the computer process, plus the application we’ll not be stable and we’ll need threading…
With the timer control we can do the clock with less problems and code lines.
You can follow the steps to create the project or just read and see the source code.
First create a new project and name it clock.
Then take a clock control and a label control (only 2 controls)
And now double click over the form and you should be in the Form Load part.
First we need to set the timer interval. For our clock: 1 second.
Timer1.Interval = 1000

Now let’s start the timer. From this line the timer will start counting.
Timer1.Start()

Now create a sub that the counter will call.
Private Sub count(ByVal MyObject As Object, _
ByVal myEventArgs As EventArgs)
Dim time As String
time = Date.Now.Hour & ":" & Date.Now.Minute & ":" & Date.Now.Second
Label1.Text = time
End Sub

The ByVal MyObject As Object and the ByVal myEventArgs As EventArgs are elementar!

Now we have to return to the form load. We need to make a relation between the timer and the sub.
So before all (starting the timer and setting the interval), add the following line.
AddHandler Timer1.Tick, AddressOf count


All is done! Now run the project.Run the project. You should see the time update every second like the Windows clock.


3- The Stop watch example

I think you understood the timer control system. So I'll give only a description of this example.
For more help read the comments to understand it better.
The speed watch as it's name, is a speed watch =)
Example aim : one button to start and stop the watch. Another button to reset.
The user can specify the interval, so another button to set the interval.

4- The alarm example

This is a clock example! But we'll added a new function: The Alarm.
You set a time where you want to show a message. When the timer control reach the time, it call the event.
For more details see the project comments.

Download the source code

The Zip file contains:
-The 3 examples source code
-The readme.txt file
-The tutorial.txt file

Still have question:
If you have any problem or you found a bug, post a comment describing your problem.
If you have a general question, we highly recommend the MSDN Forums as the best Dot Net forums in the net.

Bookmark and share this tutorial
Related Ads