Friday 24 February 2012

office management software database

office management software database in MsSql

These the database contain following table


you can download it full database from following location.
BankMst
CashOut
ClassCourse
ClassStudent
ClassTrainer
Configuration
ExpMaster
InqueryDetail
InqueryMst
MstClass
MstCollage
MstCourse
MstStudentDetail
MstTrainer
OtherFees
PaymentDetail
PaymentMaster
UserManagement
UserRole

the following database contain above table.

for any query comment so send mail to me...

Office Management 2012.0.0.1

Monday 20 February 2012

database-Chemical industry with item shell


Sample Database of Chemical industry with item shell and purchase

Here the Mysql database which is creates for chemical industry databases of Web sites for item sales and purchase.The following link for access this database. Go to link and download it. Enjoy and any query related it than post here. 
Than you

It's first release of database any further changes are release in next version

fetch ip address in c#

Socket lsock = new Socket(AddressFamily.InterNetwork, SocketType.Stream,
ProtocolType.Tcp);

 change second param to port number you are going to use

IPEndPoint lep = new IPEndPoint(IPAddress.Any, 21);
lsock.Bind(lep);
lsock.Listen(10);
Socket rsock = lsock.Accept();
Console.WriteLine(Remote IP {0},
((IPEndPoint)rsock.RemoteEndPoint).Address.ToStrin g());

Tuesday 14 February 2012

Difference between Dataset and DataReader

There is difference  between DataReader and DataSet Is List Out Here

1>
A DataReader works in a connected environment, where as DataSet works in a disconnected environment. 
2>
A DataReader object represents a forward only, read only access to data from a source. It implements IDataReader & IDataRecord interfaces. For example, The SQLDataReader class can read rows from tables in a SQL Server data source. It is returned by the ExecuteReader method of the SQLCommand class, typically as a result of a SQL Select statement. The DataReader class' HasRows property can be called to determine whether the DataReader retrieved any rows from the source. This can be used before using the Read method to check whether any data has been retrieved. 
3>
A DataSet represents an in-memory cache of data consisting of any number of inter-related DataTable objects. A DataTable object represents a tabular block of in-memory data. Further, a DataRow represents a single row of a DataTable object. A Dataset is like a mini-database engine, but its data is stored in the memory. To query the data in a DataSet, we can use a DataView object.
DataSet object DataReader object
   
Read/Write access Read-only access
   
Supports multiple tables from different databases Supports a single table based on a single SQL query of one database
   
Disconnected mode Connected mode
   
Bind to multiple controls Bind to a single control
   
Forward and backward scanning of data Forward-only scanning of data
   
Slower access to data Faster access to data
   
Greater overhead to enable additional features Lightweight object with very little overhead
   
Supported by Visual Studio .NET tools Must be manually coded

Regular Expressions IP Address Validation with .net

 Regular Expressions IP Address Validation with .net

IP Address Classes:

IP addresses are categories into five classes: Class A, Class B, Class C, Class D and Class E. Each class allows for a range of valid IP addresses. whereas classes A, B and C are used to communication.

Class A Internet Protocol (IP) address ranges include 1.0.0.0 to 126.255.255.255. This class supports 16 million hosts on each of the 127 networks. network 0.0.0.0 is reserved for use as the default route and the network 127.0.0.0 is reserved for the “loopback” function.

Class B Internet Protocol (IP) address ranges include 128.1.0.0 to 191.255.255.255. This class supports 65,000 hosts on each of the 16,000 networks.

Class D Internet Protocol (IP) address ranges include 224.0.0.0 to 239.255.255.255. This class is used to support multicasting.

Class E Internet Protocol (IP) address ranges include 240.0.0.0 to 254.255.255.254. This class is used for experimentation. Class E networks have never been documented or utilized in a standard way.


IP addresses are also commonly used to divide networks into smaller ones. This concept is called subnetting. Subnet addresses include 255.0.0.0 to 255.255.255.255


Dotted-Decimal Notation

To make Internet addresses easier for people to read and write, IP addresses are often expressed as four decimal numbers, each separated by a dot. This format is called “dotted-decimal notation.” Dotted-decimal notation divides the 32-bit Internet address into four 8- bit fields and specifies the value of each field independently as a decimal number with the fields separated by dots.

Regular Expression Pattern

^(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|25[0-5]|2[0-4]\d)$


Imports System
Imports System.IO
Imports System.Text.RegularExpressions
Public Class Form1
    Private Sub CheckIPNumber_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckIPNumber.Click
        If txtInput.Text <> "" Then
            CheckValidate(txtInput.Text)
        Else
            LblInfo.Text = "Please enter a valid IP Address"
            LblInfo.ForeColor = Color.Red
        End If
    End Sub
    Private Sub CheckValidate(ByVal strFindin As String)
        Dim myRegex As New Regex("^(([01]?\d\d?|2[0-4]\d|25[0-5])\.){3}([01]?\d\d?|25[0-5]|2[0-4]\d)$")
        If myRegex.IsMatch(strFindin) Then
            LblInfo.Text = "Valid Input"
            LblInfo.ForeColor = Color.Green
        Else
            LblInfo.Text = "Please enter a valid Ip Number"
            LblInfo.ForeColor = Color.Red
        End If
    End Sub
End Class



Monday 13 February 2012

Using Regular Expressions

System.Text.RegularExpressions Overview 

first you need to import the library for that write following code 

Imports System.Text.RegularExpressions 

at the start of your source code.

    Sub CheckProgram()
        'The regex pattern "\d+" matches one or more digit characters together
        Dim RegularExpression As Regex = New Regex("\d+")
        Dim match As Match = RegularExpression.Match("Dot 55 Perls")
        If match.Success Then
            'If the match is successful, we print its value, which is "55".
            Console.WriteLine(match.Value)
        End If
    End Sub

 these is sample example of regular expression.


Friday 10 February 2012

Create new dynamic button in vb.net

        
Create new dynamic button in vb.net
It’s very simple under stable code is following.

For add any control you must need assign name and location,
For label and textbox these method also work.
You also add dynamic textbox and label by use of these code

        Dim tmp As New Button
        tmp.Location = New System.Drawing.Point(30, 232)
        tmp.Name = "Demo"
        tmp.TabIndex = 4
        tmp.Text = "New Demo Button"
        tmp.Visible = True
        Me.Controls.Add(tmp)

Wednesday 8 February 2012

Input decimal value in textbox in vb.net


Input decimal value in textbox in vb.net

Private previousText As String
    Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        previousText = TextBox1.Text
    End Sub
    Private Sub TextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1.TextChanged
        If String.IsNullOrEmpty(DirectCast(sender, TextBox).Text) Then
            previousText = ""
        Else
            Dim num As Double = 0
            Dim success As Boolean = Double.TryParse(DirectCast(sender, TextBox).Text, num)
            If success And num >= 0 Then
                DirectCast(sender, TextBox).Text.Trim()
                previousText = DirectCast(sender, TextBox).Text
            Else
                DirectCast(sender, TextBox).Text = previousText
                DirectCast(sender, TextBox).SelectionStart = DirectCast(sender, TextBox).Text.Length
            End If
        End If
    End Sub