Infolinks In Text Ads

Invisibility Technology: Coming Soon Share

The race to make invisibility technology is on. Invisibility,may soon become a reality and through some interesting implementations, could actually serve as a useful feature in product design.

HOW TO HACK FACEBOOK ACCOUNT

These are some ways of hacking facebook account. There may be more but this time only these are in my mind.

C Programming Language

is sometimes referred to as a ``high-level assembly language.'' Some people think that's an insult, but it's actually a deliberate and significant aspect of the language.

Business

We are youth and youngsters and in todays time only aggressive, passionable, confidential youths can be better businessmen and we can do something else by which we can prove every body that we can create a new world.

FITNESS FIRST FOR WOMEN

The female-only environment of Fitness First for Women means that you'll be totally comfortable working out with us, no matter what shape or size you are - or think you are!

TRANSPARENT COMPUTER SCREEN

Transparent Computer technology has progressed rapidly, keep reading to learn more about this incredible technology.

PROJECTION KEYBOARD

A projection keyboard is a virtual keyboard that can be projected and touched on any surface. The keyboard watches finger movements and translates them into keystrokes in the device.

PROGRAMMING IN DOTNET

Dot net is advanced suite which is removing the walls between applications and the internet.

INTRODUCING HTML

The general rule with HTML tags is : For every beginning, there is an ending. The tags shown with the forward slash in them / are the ending tags.

Friday 19 August 2011

About Dot Net




About Dot Net


If you are an internet user, you may have passed through a term dot net which is actually written as “.net”. It is one of the most important and inevitable features and it is working among us now. It is a software framework for Microsoft Windows Operating System. Some of the products which are released under Microsoft .Net Framework are ASP.NET, which is a software used to build dynamically the web pages and web applications. Dot net technology can support number of languages which works together as a tool to prepare web sites.

Basically, it is a Microsoft operating system platform, which incorporates applications and suites to provide with various tools and services for altering the organization’s web strategies for their web pages and applications. There are four main principles which are necessary to know about dot net.

1- Dot net is advanced suite which is removing the walls between applications and the internet. It do not use the principle of letting on one application or website but it uses the array of computers to connect the users with the services which are exchanged or combined with the data and objects over the array.

2- The software can be rented now with the technology of Microsoft .Net and the principles of purchasing from the store shelf are not used now. In this way, the internet is housing all of the programs and applications now.

3- Users can have access to their personal information or web pages from any server, any location and any time using any kind of device compatible for internet.

4- New ways for accessing data are now available rather than keyboard or mouse input like speech or hand writing recognition making internet more user friendly.

There are four standards of dot net on which it depends and they are: SOAP, HTTP, XML and UDDI. Microsoft aims better response from this product because it has made revolution over the internet. In coming articles, you will come to learn more about dot net.

INSTALL .NET NOW




.NET is an integral part of many applications running on Windows and provides common functionality for those applications to run. This download is for people who need .NET to run an application on their computer.


.NET Framework 4


If you are a software developer, or if you need an earlier version of the .NET Framework, visit the .NET Framework: Download page for additional download options.

Thursday 18 August 2011

.NET Framework Overview

.NET is essentially a system application that runs on Windows. The heart of .NET is the .NET Framework. The most important component of the framework is the CLR as the heart and soul of the .NET architecture. Every application written using the Framework depends on the CLR. Among other things, the CLR provides a common set of data types, acting as a foundation for C#, VB, and all other languages that target the .NET Framework. Because this foundation is the same no matter which language they choose, developers see a more consistent environment.



The CLS is a statement of rules that allow each language to interoperate. For example, the CLS guarantees that Visual Basic’s idea of an integer is the same as C#. Because the two languages agree on the format of the data, they can transparently share the data. The CLS defines not only type information, but also method invocation, error handling, and so forth.

You can define a class in Visual Basic and use it in C#. A method that is defined in C# can be called by Visual Basic or any other language that adheres to the CLS. After an API is learned in one language, then using that API in any other CLS-compliant language is virtually the same.

The middle layer called Application Class Libraries and Services. This layer represents the rich set of libraries and APIs that have been created to support virtually all aspects of programming. Graphical user interface APIs or Windows.Forms, database APIs through ADO.NET, XML processing, regular expression handling, and so forth are all part of this layer.

Visual Studio .NET is an important part of the .NET Framework because it provides a means for the programmer to access the framework at any level. A programmer can use Visual Studio .NET to write code in many supported managed languages, or he can bypass the CLR altogether and write unmanaged code with Visual Studio .NET.

On the left in the figure, you can see the four languages that Microsoft has announced it will provide support for “out of the box.” The ellipsis signifies the other significant and growing set of languages that support the Common Language Specification (CLS) and are full participants in the .NET Framework. Applications written in any .NET language can use the code in the .NET Framework class library. Among the most important technologies provided in this library are the following:

ASP.NET: Classes focused on building browser-accessible applications.

Windows Forms: Classes for building Windows graphical user interfaces (GUIs) in any CLR-based programming language.

ASP.NET Web Services (also called ASMX): Classes for creating applications that communicate with other applications using Web services.

Enterprise Services: Classes that provide distributed transactions, object instance control, and other services useful for building reliable, scalable applications.

ADO.NET: Classes focused on accessing data stored in relational database management systems (DBMS).

ASP-NET-Notes(.pdf)

Wednesday 17 August 2011

Visual Basic .NET Database Programming

This simple program shows how to retrieve data from the FinAccounting database using DataReader and Data Commands. When the code in the program is executed, the data in the FinAccounting database is displayed in two textbox controls.








We use the SqlDataReader class to read data. The SqlDataReader class is defined in the System.Data.SqlClient namespace. So at the beginning of the program we need to use this class and we do so by adding the namespace. The Imports statement does this task.
Imports System.Data.SqlClient 

Public Class Form1 Inherits System.Windows.Forms.Form 

´Declare and setup the Connection string 

Dim str_connection As String = "Data Source=SYS1;Integrated Security=SSPI;
Initial Catalog=FinAccounting" 

´Declare and build a query string
Dim str_sql_user_select As String = "SELECT * FROM Accounts" 

Dim mycon As SqlConnection
Dim comUserSelect As SqlCommand 

´Declaring the DataReader object 

Dim myreader As SqlDataReader 

Private Sub Form1_Load(ByVal sender As Object,ByVal e As System.EventArgs)
Handles MyBase.Load 

´Instantiate the connection object
mycon = New SqlConnection(str_connection) 

´Instantiate the command object
comUserSelect = New SqlCommand(str_sql_user_select, mycon) 

TextBox1.Text = ""
TextBox2.Text = "" 

´Opening a Connection with the Open() method 

mycon.Open() 

´Creating a DataReader object by using
´the ExecuteReader() method of the Command object.  

myreader = comUserSelect.ExecuteReader 

If (myreader.Read = True) Then
	TextBox1.Text = myreader(0)
	TextBox2.Text = myreader(1)
Else
	MsgBox ("You have reached eof")
End If
End Sub
End Class 

Creating a Structure and Accessing Data from a Structure in visual basic 2005

A structure is a user defined type, which is used to hold multiple types of related data. A Structure is a generalization of a user defined data type (UDT). In other words, we combine variables of different data types to create a structure. We use structures when we do not want the additional functionality of an extendable class and when the structure will not contain large amount of a data. Structures are a replacement of UDT in visual basic 6.0. Compared to UDTs structures are easier to implement. We can create structure, when we want a single variable to hold multiple types of related data. In visual basic 2005, we can create a structure using Structure and End Structure statements. The members of the structure are declared in between the Structure and End Structure statements. For example, we can maintain Stock details in a single variable, we can do it as follows: 

 Structure stock_details
 Public Inv_No as String
 Public Inv_Date as Date
 Public ItemName as String
 Public Qty as Integer
 End Structure 

 The variables declared inside a structure are called data members. The access modifiers that we can use with a structure and the Access Scope defined by each access modifier for the strtucture are listed below.
  1. Public
  2. A structure declared with the Public keyword is accessible from anywhere within or outside the application. This is the default access mode.
  3. Friend
  4. A structure declared with the Friend keyword s accessible from within the program that contains its declaration and from anywhere else in the same program.
  5. Private
  6. A structure declared with the Private keyword is accessible only from within its declaration context, including any nested procedures.
  7. Protected
  8. A structure declared with the Protected keyword is accessible only from within its own class or from a derived class.
  9. Protected Friend
  10. A structure declared with the Protected Friend keyword is accessible from within the same assembly and in the derived classes.
 We can also include procedures as members of a structure. For example, if you want to include a procedure to check the value entered for the stock variable, we can define the structure as shown below: 

Structure stock_details 

	Public Inv_No As String
	Public Inv_Date As Date
	Public ItemName As String
	Public Qty As Integer 

Public Sub CheckQty(BYVal Qty As Integer)
	If Qty <  10 Then
		Qty=10  ´Qty is set to a default value 10
	End If
End Sub

End Structure
VB.NET - Database(pdf)

VB – ASP.NET Database Programming


Creating a Web Project and Connecting to the Database
Before we can create our Data Access Layer (DAL), we first need to create a web site and setup our database. Start by creating a new file system-based ASP.NET web site. To accomplish this, go to the File menu and choose New Web Site, displaying the New Web Site dialog box. Choose the ASP.NET Web Site template, set the Location drop-down list to File System, choose a folder to place the web site, and set the language to C#.


This will create a new web site with a Default.aspx ASP.NET page and an App_Datafolder.
With the web site created, the next step is to add a reference to the database in Visual Studio‘s Server Explorer. By adding a database to the Server Explorer you can add tables, stored procedures, views, and so on all from within Visual Studio. You can also view table data or create your own queries either by hand or graphically via the Query Builder. Furthermore, when we build the Typed DataSets for the DAL we’ll need to point Visual Studio to the database from which the Typed DataSets should be constructed. While we can provide this connection information at that point in time, Visual Studio automatically populates a drop-down list of the databases already registered in the Server Explorer.
The steps for adding the Northwind database to the Server Explorer depend on whether you want to use the SQL Server 2005 Express Edition database in theApp_Data folder or if you have a Microsoft SQL Server 2000 or 2005 database server setup that you want to use instead.

Using a Database in the App_Data Folder

If you do not have a SQL Server 2000 or 2005 database server to connect to, or you simply want to avoid having to add the database to a database server, you can use the SQL Server 2005 Express Edition version of the Northwind database that is located in the downloaded website’s App_Data folder (NORTHWND.MDF).
A database placed in the App_Data folder is automatically added to the Server Explorer. Assuming you have SQL Server 2005 Express Edition installed on your machine you should see a node named NORTHWND.MDF in the Server Explorer, which you can expand and explore its tables, views, stored procedure, and so on (see Figure 2).
The App_Data folder can also hold Microsoft Access .mdb files, which, like their SQL Server counterparts, are automatically added to the Server Explorer. If you don’t want to use any of the SQL Server options, you can always download a Microsoft Access version of the Northwind database file and drop into the App_Data directory. Keep in mind, however, that Access databases aren’t as feature-rich as SQL Server, and aren’t designed to be used in web site scenarios. Furthermore, a couple of the 35+ tutorials will utilize certain database-level features that aren’t supported by Access.

Connecting to the Database in a Microsoft SQL Server 2000 or 2005Database Server

Alternatively, you may connect to a Northwind database installed on a database server. If the database server does not already have the Northwind database installed, you first must add it to database server by running the installation script included in this tutorial’s download or by downloading the SQL Server 2000 version of Northwind and installation script directly from Microsoft’s web site.
Once you have the database installed, go to the Server Explorer in Visual Studio, right-click on the Data Connections node, and choose Add Connection. If you don’t see the Server Explorer go to the View / Server Explorer, or hit Ctrl+Alt+S. This will bring up the Add Connection dialog box, where you can specify the server to connect to, the authentication information, and the database name. Once you have successfully configured the database connection information and clicked the OK button, the database will be added as a node underneath the Data Connections node. You can expand the database node to explore its tables, views, stored procedures, and so on.

Step 2: Creating the Data Access Layer

When working with data one option is to embed the data-specific logic directly into the presentation layer (in a web application, the ASP.NET pages make up the presentation layer). This may take the form of writing ADO.NET code in the ASP.NET page’s code portion or using the SqlDataSource control from the markup portion. In either case, this approach tightly couples the data access logic with the presentation layer. The recommended approach, however, is to separate the data access logic from the presentation layer. This separate layer is referred to as the Data Access Layer, DAL for short, and is typically implemented as a separate Class Library project. The benefits of this layered architecture are well documented (see the “Further Readings” section at the end of this tutorial for information on these advantages) and is the approach we will take in this series.
All code that is specific to the underlying data source such as creating a connection to the database, issuing SELECTINSERTUPDATE, and DELETE commands, and so on should be located in the DAL. The presentation layer should not contain any references to such data access code, but should instead make calls into the DAL for any and all data requests. Data Access Layers typically contain methods for accessing the underlying database data. The Northwind database, for example, has Productsand Categories tables that record the products for sale and the categories to which they belong. In our DAL we will have methods like:
  • GetCategories(), which will return information about all of the categories
  • GetProducts(), which will return information about all of the products
  • GetProductsByCategoryID(categoryID), which will return all products that belong to a specified category
  • GetProductByProductID(productID), which will return information about a particular product
These methods, when invoked, will connect to the database, issue the appropriate query, and return the results. How we return these results is important. These methods could simply return a DataSet or DataReader populated by the database query, but ideally these results should be returned using strongly-typed objects. A strongly-typed object is one whose schema is rigidly defined at compile time, whereas the opposite, a loosely-typed object, is one whose schema is not known until runtime.
For example, the DataReader and the DataSet (by default) are loosely-typed objects since their schema is defined by the columns returned by the database query used to populate them. To access a particular column from a loosely-typed DataTable we need to use syntax like: DataTable.Rows[index]["columnName"]. The DataTable’s loose typing in this example is exhibited by the fact that we need to access the column name using a string or ordinal index. A strongly-typed DataTable, on the other hand, will have each of its columns implemented as properties, resulting in code that looks like: DataTable.Rows[index].columnName.
To return strongly-typed objects, developers can either create their own custom business objects or use Typed DataSets. A business object is implemented by the developer as a class whose properties typically reflect the columns of the underlying database table the business object represents. A Typed DataSet is a class generated for you by Visual Studio based on a database schema and whose members are strongly-typed according to this schema. The Typed DataSet itself consists of classes that extend the ADO.NET DataSet, DataTable, and DataRow classes. In addition to strongly-typed DataTables, Typed DataSets now also include TableAdapters, which are classes with methods for populating the DataSet’s DataTables and propagating modifications within the DataTables back to the database.
We’ll use strongly-typed DataSets for these tutorials’ architecture. Figure 3 illustrates the workflow between the different layers of an application that uses Typed DataSets.

Creating a Typed DataSet and Table Adapter

To begin creating our DAL, we start by adding a Typed DataSet to our project. To accomplish this, right-click on the project node in the Solution Explorer and choose Add a New Item. Select the DataSet option from the list of templates and name itNorthwind.xsd.

After clicking Add, when prompted to add the DataSet to the App_Code folder, choose Yes. The Designer for the Typed DataSet will then be displayed, and the TableAdapter Configuration Wizard will start, allowing you to add your first TableAdapter to the Typed DataSet.
A Typed DataSet serves as a strongly-typed collection of data; it is composed of strongly-typed DataTable instances, each of which is in turn composed of strongly-typed DataRow instances. We will create a strongly-typed DataTable for each of the underlying database tables that we need to work with in this tutorials series. Let’s start with creating a DataTable for the Products table.
Keep in mind that strongly-typed DataTables do not include any information on how to access data from their underlying database table. In order to retrieve the data to populate the DataTable, we use a TableAdapter class, which functions as our Data Access Layer. For our Products DataTable, the TableAdapter will contain the methodsGetProducts()GetProductByCategoryID(categoryID), and so on that we’ll invoke from the presentation layer. The DataTable’s role is to serve as the strongly-typed objects used to pass data between the layers.
The TableAdapter Configuration Wizard begins by prompting you to select which database to work with. The drop-down list shows those databases in the Server Explorer. If you did not add the Northwind database to the Server Explorer, you can click the New Connection button at this time to do so.

Differences Between Microsoft Visual Basic .NET and Microsoft Visual C# .NET


Syntactically, Visual Basic .NET and Visual C# .NET are two different languages, just as Visual Basic, Visual C, and Visual C++ are different languages. Visual C# .NET looks more familiar to Visual C, Visual C++, and Java programmers, and Visual Basic .NET looks more familiar to Visual Basic developers. The biggest differences between the languages fall into the following categories:
  • Case sensitivity
  • Variable declaration and assignment
  • Data types
  • Statement termination
  • Statement blocks
  • Use of () vs. []
  • Operators
  • Conditional statements
  • Error handling
  • Overflow checking
  • Parameter passing
  • Late binding
  • Handling unmanaged code

Server Sockets and Listeners


 Server Sockets and Listeners
 We were able to contact the NIST server because it was already listening.  If we want to be able to set up a network connection entirely on our own, say between two students in this class, then both computers will have to create sockets, and one will have to be “listening”.   If  this is done at a low level,  using methods of the Socket class, it requires a basic knowledge of threads.  Here is the reason, which can be explained in language-independent terms.  What needs to happen is this:
  • We need to create a “server socket” and set it to “listen”.  It then waits until some client tries to connect.
  • Then,  the socket needs to “accept” the client,  and at that point the socket can be used to transmit and receive data.
While the socket is “listening”, however,  execution doesn’t continue.  It “hangs” at the Listen line of code and doesn’t go beyond until a connection is made.   So,  unless we want our whole program to be unusable after you press the Listen button until someone connects,  we have to create a separate “thread” of execution to handle the Listen command.
Since this is a common task in network programming,  .NET has provided a special class to handle this task, that is usable without a knowledge of the System.Threading library.    Specifically, there is a .NET class TcpListener.  We will use that class in the next example.
Inter-Process Communication i.e. the capability of two or more physically connected machines to exchange data, plays a very important role in enterprise software development. TCP/IP is the most common standard adopted for such communication. Under TCP/IP each machine is identified by a unique 4 byte integer referred to as its IP address (usually formatted as 192.168.0.101). For easy remembrance, this IP address is mostly bound to a user-friendly host name. The program below (showip.cs) uses the System.Net.Dns class to display the IP address of the machine whose name is passed in the first command-line argument. In the absence of command-line arguments, it displays the name and IP address of the local machine.
using System;
using System.Net;
class ShowIP{
    public static void Main(string[] args){
        string name = (args.Length < 1) ? Dns.GetHostName() : args[0];
        try{
            IPAddress[] addrs = Dns.Resolve(name).AddressList;
            foreach(IPAddress addr in addrs)
                Console.WriteLine("{0}/{1}",name,addr);
        }catch(Exception e){
            Console.WriteLine(e.Message);
        }
    }
}
Dns.GetHostName() returns the name of the local machine and Dns.Resolve() returns IPHostEntry for a machine with a given name, the AddressList property of which returns the IPAdresses of the machine. TheResolve method will cause an exception if the mentioned host is not found.
Though IPAddress allows to identify machines in the network, each machine may host multiple applications which use network for data exchange. Under TCP/IP, each network oriented application binds itself to a unique 2 byte integer referred to as its port-number which identifies this application on the machine it is executing. The data transfer takes place in the form of byte bundles called IP Packets or Datagrams. The size of each datagram is 64 KByte and it contains the data to be transferred, the actual size of the data, IP addresses and port-numbers of sender and the prospective receiver. Once a datagram is placed on a network by a machine, it will be received physically by all the other machines but will be accepted only by that machine whose IP address matches with the receiver�s IP address in the packet. Later on, this machine will transfer the packet to an application running on it which is bound to the receiver�s port-number present in the packet.
TCP/IP suite actually offers two different protocols for data exchange. The Transmission Control Protocol (TCP) is a reliable connection oriented protocol while the User Datagram Protocol (UDP) is not very reliable (but fast) connectionless protocol.

First network programming example


First network programming example
 There is a server in Boulder, Colorado,  that provides the exact time of day (in Greenwich Mean Time) upon request.   You can contact that server via the Telnet utility (from a command line) to see what output it provides.  The 13 on the command line is the port number at which the service is provided.  Notice that the command line provides a domain name and port number, just what is needed to construct a remote endpoint.
What is not quite obvious from this printout (until I point it out) is that the output from the server begins and ends with a newline. The output specifies today’s date and time.  It doesn’t matter for our purposes what the rest of the output is.   NIST is the National Institute of Standards,  which maintains this server.
 What we want to do is write our own low-level network program to establish a socket connection to the NIST.    Here are the steps to do this:
 1.   Make a new  C# Windows Application  called NetworkDemo.   Drag onto your form a button (label it Get Time)  and a multi-line list box to receive the output.   The idea is that when you click the button,  a connection will be established to the NIST server and the output will be displayed in the list box.
 2.   All the interesting code will be in the GetTimeButton_Click handler.  Here it is:
 IPHostEntry resolvedServer;
IPEndPoint serverEndPoint;
Socket tcpSocket = null;
try
{ resolvedServer =
     Dns.GetHostEntry(“time-A.timefreq.bldrdoc.gov”);
     // here is where we use DNS to get an IP adress
     // Actually,  an IPHostEntry can contain a whole
     // list of possible IP addresses for the domain.
  foreach (IPAddress addr in resolvedServer.AddressList)
  {
    tcpSocket = new Socket(
            addr.AddressFamily,
            SocketType.Stream,
            ProtocolType.Tcp);
    serverEndPoint = new IPEndPoint(addr, 13);
    /* the time of day service is on port 13 */
    try
       {
         tcpSocket.Connect(serverEndPoint);
       }
    catch
       { // connect failed so try the next one
         if (tcpSocket != null)
             tcpSocket.Close();
         continue;
       }
    break;  // successful connection
  }
}
catch (SocketException err)
{
  textBox1.Text = ”Client connection failed” + err.Message;
}
// now tcpSocket is open, use it
byte[] receiveBuffer = new byte[1024];
int nReceived;
String sReceived;
try
{
  textBox1.Clear();
  textBox1.Text = ”";
  nReceived = tcpSocket.Receive(receiveBuffer);
  sReceived =
   Encoding.UTF8.GetString(receiveBuffer).Substring(1,49);
  // we don’t want the initial and final newlines
  textBox1.Text = sReceived.Trim();
  // for some reason Trim doesn’t get rid of the final
  // newline character as the documentation says it should.
  /* The following low-level code also works:
     for (int i = 0; i < nReceived; i++)
       if(receiveBuffer[i] != ‘\n’)
          textBox1.Text += (char) receiveBuffer[i];
       if(receiveBuffer[i] == ”)
           break;
  */
}
catch (SocketException)
{
  textBox1.Text = ”Some unforeseen error occurred”;
}
}

Domain Name Servers (DNS)


Domain Name Servers (DNS)
Where will we get the remote IP address that we need?   Well, we could make a telephone call or send an email to the person at the other end—but that isn’t a practical method for many purposes.  Instead we want to be able to mention an internet domain name.  When you set up a computer to connect to the internet, you have to specify one or more IP addresses for a domain name server. Then your local operating system knows how to request an IP address for a given domain name, and the DNS server supplies it.  Taking advantage of this low-level service, we will be able to construct a remote endpoint from a domain name and a port number.

Network Programming in .NET


Basic concepts of network programming
 To set up a communication channel between two computers, we will need a pair of endpoints, and a communication protocol (some way of interpreting the data, and a way of establishing the connection between the two endpoints, and a way of ending the “conversation” politely).   One such communication protocol is called TCP  (Transport Control Protocol).  We leave it to your networking course to supply details about TCP and TCP/IP, but .NET makes it possible to write network programs without knowing anything about TCP.   There exist other communication protocols, but we will use only TCP in this lecture.
 To summarize:  to create a usable communications channel we need two endpoints and a protocol,  or otherwise described, we need
  • A local IP address
  • A local port number
  • A remote IP address
  • A remote port number
  • A transport protocol
 A data structure that encapsulates these five things is called a “socket”.
The concept of “socket” is independent of .NET and even independent of Windows—every modern operating system has a way to construct sockets.
Sockets are provided for Windows in the Winsock library, and for Unix in the Berkeley sockets library.   The Winsock library functions are wrapped in the .NET Socket class.
 The Socket class also provides a Connect method.   That in turn calls on ancient code in the Winsock library to establish a connection between the local endpoint and the remote endpoint.   That,  of course, is only going to work if the remote endpoint is “listening”,  i.e.  is ready to receive a connection request and do its part to establish the connection.
Once we have successfully established a connection to a remote endpoint, we can use the Socket class method Receive to receive data.

Twitter Delicious Facebook Digg Stumbleupon Favorites More