Object Oriented Approach for Database application

Mohan

Member
Joined
Oct 18, 2006
Messages
17
Location
bangalore
Programming Experience
1-3
can anybody help how to develop Database application completely in OOPS way.

means classes for database Tables, considerning Columns as members of the class.

Adding new record, modifying records, deleting records to be treated as methods...

it will be great help if any of u provide me a sample application so i can do rest of my project and learn VB.NET...
 
Here is a sample class from the app I wrote to write my table wrappers for me - It uses inline sql and is for MySQL. Let me know if you want to see the SQL Server version with stored procedures.

VB.NET:
[SIZE=2][COLOR=#0000ff]Imports[/COLOR][/SIZE][SIZE=2] MySql.Data.MySqlClient[/SIZE]
[SIZE=2][COLOR=#008000]'****************************************************************************[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]' Code Generated by AppWrite Version 3.0.7 - Inline SQL Version[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]' for Microsoft.NET 1.1 / MySQL 5.1[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]' Written by Geraint Williams (c) 2006[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]' ---------------------------------------------------------------------------[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]' Project Version: & 1.0.18 on 17/09/2006 11:14:14[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'****************************************************************************[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'@MySQL Data Object conforming to mdo Design Pattern [/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Class[/COLOR][/SIZE][SIZE=2] mdo_Company[/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_CompanyID [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_CompanyCode [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_CompanyName [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_CreatedBy [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_CreatedOn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_UpdatedBy [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] m_UpdatedOn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] CompanyID() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_CompanyID[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]m_CompanyID = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] CompanyCode() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_CompanyCode[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]m_CompanyCode = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] CompanyName() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_CompanyName[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]m_CompanyName = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] CreatedBy() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_CreatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] Value.Length > 50 [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]Value = Value.substring(0, 50)[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2]m_CreatedBy = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] CreatedOn() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_CreatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]m_CreatedOn = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] UpdatedBy() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_UpdatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] Value.Length > 50 [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]Value = Value.substring(0, 50)[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2]m_UpdatedBy = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][SIZE=2] UpdatedOn() [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][SIZE=2] m_UpdatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] Value [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]m_UpdatedOn = Value[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] LoadData([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] ID [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cnn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlConnection[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlCommand[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] dr [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlDataReader[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] ID = 0 [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]ClearData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Exit[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE][SIZE=2][COLOR=#008000]'after ID=0 check to avoid finalisation issues[/COLOR][/SIZE]
[SIZE=2]cnn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlConnection(mdo_Connection.ConnectionString)[/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand("SELECT * FROM Company WHERE CompanyID = " & ID, cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.text[/SIZE]
[SIZE=2]cnn.Open()[/SIZE]
[SIZE=2]dr = cmd.ExecuteReader[/SIZE]
[SIZE=2][COLOR=#0000ff]Do[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]While[/COLOR][/SIZE][SIZE=2] dr.Read()[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("CompanyID") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_CompanyID = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("CompanyID"), [/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("CompanyCode") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_CompanyCode = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("CompanyCode"), [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("CompanyName") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_CompanyName = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("CompanyName"), [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("CreatedBy") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_CreatedBy = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("CreatedBy"), [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("CreatedOn") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_CreatedOn = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("CreatedOn"), [/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("UpdatedBy") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_UpdatedBy = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("UpdatedBy"), [/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] (dr("UpdatedOn") [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2] DBNull.Value) [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] m_UpdatedOn = [/SIZE][SIZE=2][COLOR=#0000ff]CType[/COLOR][/SIZE][SIZE=2](dr("UpdatedOn"), [/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#0000ff]Loop[/COLOR][/SIZE]
[SIZE=2]dr.close()[/SIZE]
[SIZE=2]cnn.Close()[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Finally[/COLOR][/SIZE]
[SIZE=2]dr = [/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] cmd.Dispose()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] SaveData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2] m_CompanyID = 0 [/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[SIZE=2]SaveNewData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Else[/COLOR][/SIZE]
[SIZE=2]SaveEditData()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] SaveNewData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cnn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlConnection[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlCommand[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] sqlInsert [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Note: Primary Key is ommited from sql command string and parameters[/COLOR][/SIZE]
[SIZE=2]sqlInsert = "INSERT INTO Company ( CompanyCode, CompanyName, CreatedBy, CreatedOn, UpdatedBy, UpdatedOn ) "[/SIZE]
[SIZE=2]sqlInsert += " VALUES ( ?CompanyCode, ?CompanyName, ?CreatedBy, ?CreatedOn, ?UpdatedBy, ?UpdatedOn ) "[/SIZE]
[SIZE=2]cnn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlConnection(mdo_Connection.ConnectionString)[/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand(sqlInsert, cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyCode", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyCode[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyName", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyName[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
 
[SIZE=2]cnn.Open()[/SIZE]
[SIZE=2]cmd.ExecuteNonQuery()[/SIZE]
[SIZE=2][COLOR=#008000]'Retrieve last inserted ID and assign to primary key[/COLOR][/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand("SELECT LAST_INSERT_ID()", cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2]m_CompanyID = cmd.ExecuteScalar[/SIZE]
[SIZE=2]cnn.Close()[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Finally[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] cmd.Dispose()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] SaveEditData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cnn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlConnection[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlCommand[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] sqlUpdate [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Note: Primary Key is ommited from sql command string and parameters[/COLOR][/SIZE]
[SIZE=2]sqlUpdate = "UPDATE Company SET CompanyCode = ?CompanyCode , CompanyName = ?CompanyName _[/SIZE]
[SIZE=2]        ,CreatedBy=?CreatedBy, CreatedOn=?CreatedOn, UpdatedBy=?UpdatedBy, UpdatedOn=?UpdatedOn "[/SIZE]
[SIZE=2]sqlUpdate += " WHERE CompanyID = " & m_CompanyID[/SIZE]
[SIZE=2]cnn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlConnection(mdo_Connection.ConnectionString)[/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand(sqlUpdate, cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyCode", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyCode[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyName", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyName[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
 
[SIZE=2]cnn.Open()[/SIZE]
[SIZE=2]cmd.ExecuteNonQuery()[/SIZE]
[SIZE=2]cnn.Close()[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Finally[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] cmd.Dispose()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
 
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] SaveWithTransaction([/SIZE][SIZE=2][COLOR=#0000ff]ByRef[/COLOR][/SIZE][SIZE=2] cnn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlConnection, [/SIZE][SIZE=2][COLOR=#0000ff]ByRef[/COLOR][/SIZE][SIZE=2] myTrans [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlTransaction)[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlCommand[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] sqlInsert [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#008000]'Note: Primary Key is ommited from sql command string and parameters[/COLOR][/SIZE]
[SIZE=2]sqlInsert = "INSERT INTO Company ( CompanyCode, CompanyName, CreatedBy, CreatedOn, UpdatedBy, UpdatedOn ) "[/SIZE]
[SIZE=2]sqlInsert += " VALUES ( ?CompanyCode, ?CompanyName, ?CreatedBy, ?CreatedOn, ?UpdatedBy, ?UpdatedOn ) "[/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand(sqlInsert, cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2]cmd.Transaction = myTrans[/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyCode", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyCode[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CompanyName", MySqlDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CompanyName[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?CreatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_CreatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedBy", MySQLDbType.VarChar)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedBy[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE][SIZE=2] cmd.Parameters.Add("?UpdatedOn", MySQLDbType.DateTime)[/SIZE]
[SIZE=2].Direction = ParameterDirection.Input[/SIZE]
[SIZE=2].Value = m_UpdatedOn[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]With[/COLOR][/SIZE]
[SIZE=2]cmd.ExecuteNonQuery()[/SIZE]
[SIZE=2][COLOR=#008000]'Retrieve last inserted ID and assign to primary key[/COLOR][/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand("SELECT LAST_INSERT_ID()", cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2]cmd.Transaction = myTrans[/SIZE]
[SIZE=2]m_CompanyID = cmd.ExecuteScalar[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception[/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Finally[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] cmd.Dispose()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] DeleteData()[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cnn [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlConnection[/SIZE]
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] MySqlCommand[/SIZE]
[SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2]cnn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlConnection(mdo_Connection.ConnectionString)[/SIZE]
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] MySqlCommand("DELETE FROM Company WHERE CompanyID = " & m_CompanyID, cnn)[/SIZE]
[SIZE=2]cmd.CommandType = CommandType.Text[/SIZE]
[SIZE=2]cnn.Open()[/SIZE]
[SIZE=2]cmd.ExecuteNonQuery()[/SIZE]
[SIZE=2]cnn.Close()[/SIZE]
[SIZE=2][COLOR=#0000ff]Catch[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] Exception[/SIZE]
[SIZE=2][COLOR=#008000]'Calling function handles exception[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Throw[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Finally[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Not[/COLOR][/SIZE][SIZE=2] cmd [/SIZE][SIZE=2][COLOR=#0000ff]Is[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Nothing[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE][SIZE=2] cmd.Dispose()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Try[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] ClearData()[/SIZE]
 
 
[SIZE=2]m_CompanyID = 0[/SIZE]
[SIZE=2]m_CompanyCode = ""[/SIZE]
[SIZE=2]m_CompanyName = ""[/SIZE]
[SIZE=2]m_CreatedBy = ""[/SIZE]
[SIZE=2]m_UpdatedBy = ""[/SIZE]
[SIZE=2]m_CreatedOn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2]m_UpdatedOn = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Date[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2]()[/SIZE]
[SIZE=2]ClearData()[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] ID [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Integer[/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2]ClearData()[/SIZE]
[SIZE=2]LoadData(ID)[/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]Class[/COLOR][/SIZE]
 
Last edited:
ok SQL server version - stored procedures in next post

VB.NET:
Imports System.Data.SqlClient
'****************************************************************************
' Code Generated by ViDAL Version 1.0
' for Microsoft.NET 2.0 / SQLServer 2005
' (c)Geraint Williams 2006. All rights reserved.
'****************************************************************************
'SQL Data Object conforming to ViDAL Design Pattern 
Public Class sdo_Company
    private m_CompanyID as Integer
    private m_CompanyCode as String
    private m_CompanyName as String
    private m_CreatedBy as String
    private m_CreatedOn as Date
    private m_UpdatedBy as String
    private m_UpdatedOn as Date
    private m_LastUpdate as Byte()
    Property CompanyID() As Integer
        Get
            Return m_CompanyID
        End Get
        Set(ByVal Value As Integer)
            m_CompanyID = Value
        End Set
    End Property
    Property CompanyCode() As String
        Get
            Return m_CompanyCode
        End Get
        Set(ByVal Value As String)
            If Value.length > 3 then
                value=value.substring(0,3)
            End if
            m_CompanyCode = Value
        End Set
    End Property
    Property CompanyName() As String
        Get
            Return m_CompanyName
        End Get
        Set(ByVal Value As String)
            If Value.length > 50 then
                value=value.substring(0,50)
            End if
            m_CompanyName = Value
        End Set
    End Property
    Property CreatedBy() As String
        Get
            Return m_CreatedBy
        End Get
        Set(ByVal Value As String)
            If Value.length > 50 then
                value=value.substring(0,50)
            End if
            m_CreatedBy = Value
        End Set
    End Property
    Property CreatedOn() As Date
        Get
            Return m_CreatedOn
        End Get
        Set(ByVal Value As Date)
            m_CreatedOn = Value
        End Set
    End Property
    Property UpdatedBy() As String
        Get
            Return m_UpdatedBy
        End Get
        Set(ByVal Value As String)
            If Value.length > 50 then
                value=value.substring(0,50)
            End if
            m_UpdatedBy = Value
        End Set
    End Property
    Property UpdatedOn() As Date
        Get
            Return m_UpdatedOn
        End Get
        Set(ByVal Value As Date)
            m_UpdatedOn = Value
        End Set
    End Property
    Property LastUpdate() As Byte()
        Get
            Return m_LastUpdate
        End Get
        Set(ByVal Value As Byte())
            m_LastUpdate = Value
        End Set
    End Property
Public Sub LoadData(ByVal ID As Integer)
    Dim cnn As SQLConnection
    Dim cmd As SQLCommand
    Dim dr As SQLDataReader
    if ID=0 then
        ClearData
        Exit Sub
    End if
    Try  'after ID=0 check to avoid finalisation issues
        cnn = New SQLConnection(My.Settings.ConnectionString)
        cmd = New SQLCommand("_Company$select" , cnn)
        cmd.CommandType = CommandType.StoredProcedure
        With cmd.Parameters.Add("@CompanyID", SQLDbType.Int)
            .Direction = ParameterDirection.Input
            .Value = ID
        End With
        cnn.Open()
        dr = cmd.ExecuteReader
        Do While dr.Read()
            If Not (dr("CompanyID") Is DBNull.Value) Then m_CompanyID = CTYPE(dr("CompanyID"),Integer)
            If Not (dr("CompanyCode") Is DBNull.Value) Then m_CompanyCode = CTYPE(dr("CompanyCode"),String)
            If Not (dr("CompanyName") Is DBNull.Value) Then m_CompanyName = CTYPE(dr("CompanyName"),String)
            If Not (dr("CreatedBy") Is DBNull.Value) Then m_CreatedBy = CTYPE(dr("CreatedBy"),String)
            If Not (dr("CreatedOn") Is DBNull.Value) Then m_CreatedOn = CTYPE(dr("CreatedOn"),Date)
            If Not (dr("UpdatedBy") Is DBNull.Value) Then m_UpdatedBy = CTYPE(dr("UpdatedBy"),String)
            If Not (dr("UpdatedOn") Is DBNull.Value) Then m_UpdatedOn = CTYPE(dr("UpdatedOn"),Date)
            If Not (dr("LastUpdate") Is DBNull.Value) Then m_LastUpdate = CTYPE(dr("LastUpdate"),Byte())
        Loop
        dr.close()
        cnn.Close()
        dr=nothing
        cmd.Dispose()
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub SaveData()
    Try
        If m_CompanyID = 0 Then
            InsertData()
        Else
            UpdateData()
        End If
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Private Sub InsertData() 
    Dim cnn As SQLConnection
    Dim cmd As SQLCommand
    Try
        cnn = New SQLConnection(My.Settings.ConnectionString)
        cmd = New SQLCommand("_Company$insert" , cnn)
        cmd.CommandType = CommandType.StoredProcedure
        With cmd.Parameters.Add("@CompanyCode", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyCode
        End With
        With cmd.Parameters.Add("@CompanyName", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyName
        End With
        With cmd.Parameters.Add("@CreatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedBy
        End With
        With cmd.Parameters.Add("@CreatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedOn
        End With
        With cmd.Parameters.Add("@UpdatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedBy
        End With
        With cmd.Parameters.Add("@UpdatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedOn
        End With
        With cmd.Parameters.Add("@NewKey", SQLDbType.Int)
            .Direction = ParameterDirection.Output
            .Value = 0
        End With

        cnn.Open()
        cmd.ExecuteNonQuery()
        m_CompanyID = cint(cmd.Parameters("@NewKey").Value)
        cnn.Close()
        cmd.Dispose()
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Private Sub UpdateData()
    Dim cnn As SQLConnection
    Dim cmd As SQLCommand
    Try
        cnn = New SQLConnection(My.Settings.ConnectionString)
        cmd = New SQLCommand("_Company$update" , cnn)
        cmd.CommandType = CommandType.StoredProcedure
        With cmd.Parameters.Add("@CompanyID", SQLDbType.int)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyID
        End With
        With cmd.Parameters.Add("@CompanyCode", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyCode
        End With
        With cmd.Parameters.Add("@CompanyName", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyName
        End With
        With cmd.Parameters.Add("@CreatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedBy
        End With
        With cmd.Parameters.Add("@CreatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedOn
        End With
        With cmd.Parameters.Add("@UpdatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedBy
        End With
        With cmd.Parameters.Add("@UpdatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedOn
        End With
        With cmd.Parameters.Add("@LastUpdate", SQLDbType.timestamp)
            .Direction = ParameterDirection.Input
            .Value = m_LastUpdate
        End With

        cnn.Open()
        cmd.ExecuteNonQuery()
        cnn.Close()
        cmd.Dispose()
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub SaveWithTransaction(ByRef cnn As SQLConnection, ByRef myTrans As SQLTransaction) 
    Dim cmd As SQLCommand
    Try
        cmd = New SQLCommand("_Company$insert" , cnn)
        cmd.CommandType = CommandType.StoredProcedure
        cmd.Transaction = myTrans
        With cmd.Parameters.Add("@CompanyCode", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyCode
        End With
        With cmd.Parameters.Add("@CompanyName", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyName
        End With
        With cmd.Parameters.Add("@CreatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedBy
        End With
        With cmd.Parameters.Add("@CreatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_CreatedOn
        End With
        With cmd.Parameters.Add("@UpdatedBy", SQLDbType.varchar)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedBy
        End With
        With cmd.Parameters.Add("@UpdatedOn", SQLDbType.datetime)
            .Direction = ParameterDirection.Input
            .Value = m_UpdatedOn
        End With
        With cmd.Parameters.Add("@NewKey", SQLDbType.Int)
            .Direction = ParameterDirection.Output
            .Value = 0
        End With
        cmd.ExecuteNonQuery()
        m_CompanyID = cint(cmd.Parameters("@NewKey").Value)
        'Do not close connection object
        cmd.Dispose()
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub DeleteData()
    Dim cnn As SQLConnection
    Dim cmd As SQLCommand
    Try
        cnn = New SQLConnection(My.Settings.ConnectionString)
        cmd = New SQLCommand("_Company$delete", cnn)
        cmd.CommandType = CommandType.StoredProcedure
        With cmd.Parameters.Add("@CompanyID", SQLDbType.int)
            .Direction = ParameterDirection.Input
            .Value = m_CompanyID
        End With
        With cmd.Parameters.Add("@LastUpdate", SQLDbType.timestamp)
            .Direction = ParameterDirection.Input
            .Value = m_LastUpdate
        End With
        cnn.Open()
        cmd.ExecuteNonQuery()
        cnn.Close()
        cmd.Dispose()
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub ClearData()
    Try
        m_CompanyID = 0
        m_CompanyCode = ""
        m_CompanyName = ""
        m_CreatedBy = ""
        m_CreatedOn = New Date
        m_UpdatedBy = ""
        m_UpdatedOn = New Date
        m_LastUpdate = Nothing
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub New()
    Try
        ClearData
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
Public Sub New(ByVal ID as Integer)
    Try
        ClearData
        LoadData(ID)
    Catch
        'Calling function handles exception
        Throw
    End Try
End Sub
End Class
 
Stored procedures for above data object

VB.NET:
/********************************************************************
 * Code Generated by ViDAL Version 1.0
 * Create date: 21/10/2006 01:10:06
 **********************************************************************/
CREATE PROCEDURE _Company$insert 
  @CompanyCode varchar(3) ,
  @CompanyName varchar(50) ,
  @CreatedBy varchar(50) ,
  @CreatedOn datetime ,
  @UpdatedBy varchar(50) ,
  @UpdatedOn datetime ,
  @NewKey int = NULL OUTPUT
 AS 
DECLARE @rowcount AS int,
        @error AS int,
        @msg AS varchar(255),
        @tranName AS sysname,
        @msgTag AS varchar(255)
-- set up error message tag and transaction name
SET @msgTag = '<' + object_name(@@procID) + ';TYPE=P'
SET @tranName = object_name(@@procid) + CAST(@@nestlevel AS VARCHAR(2))
BEGIN TRANSACTION
SAVE TRANSACTION @tranName
--start data insert
INSERT INTO Company ( CompanyCode,  CompanyName,  CreatedBy,  CreatedOn,  UpdatedBy,  UpdatedOn )
VALUES ( @CompanyCode,  @CompanyName,  @CreatedBy,  @CreatedOn,  @UpdatedBy,  @UpdatedOn )
--get rowcount and error level
SELECT @rowcount = @@rowcount, @error = @@error
IF @error != 0 --fatal external error
    BEGIN
        ROLLBACK TRANSACTION @tranName
        COMMIT TRANSACTION
        SELECT @msg = 'External error in _Company$insert procedure. ' + @msgTag + ' CALL=(INSERT Company)>'
        RAISERROR 500001 @msg
        RETURN -100
    END
--it's all good
SET @NewKey = @@Identity
COMMIT TRANSACTION
RETURN 0
GO

CREATE PROCEDURE _Company$update
  @CompanyID int ,
  @CompanyCode varchar(3) ,
  @CompanyName varchar(50) ,
  @CreatedBy varchar(50) ,
  @CreatedOn datetime ,
  @UpdatedBy varchar(50) ,
  @UpdatedOn datetime ,
  @LastUpdate timestamp
 AS 
DECLARE @rowcount AS int,
        @error AS int,
        @msg AS varchar(255),
        @tranName AS sysname,
        @msgTag AS varchar(255)
-- set up error message tag and transaction name
SET @msgTag = '<' + object_name(@@procID) + ';TYPE=P;keyvalue=@CompanyID:' + CONVERT(varchar(10),@CompanyID) 
SET @tranName = object_name(@@procid) + CAST(@@nestlevel AS VARCHAR(2))
--make sure optimistic lock value is valid 
IF @LastUpdate IS NULL
    BEGIN
       SET @msg = 'The LastUpdate value must not be NULL' + @msgTag + '>'
           RAISERROR 50000 @msg
           RETURN -100
       END
BEGIN TRANSACTION
SAVE TRANSACTION @tranName
--start data update
UPDATE Company SET CompanyCode = @CompanyCode, CompanyName = @CompanyName, CreatedBy = @CreatedBy, CreatedOn = @CreatedOn, UpdatedBy = @UpdatedBy, UpdatedOn = @UpdatedOn
WHERE CompanyID = @CompanyID AND LastUpdate = @LastUpdate    
--get rowcount and error level
SELECT @rowcount = @@rowcount, @error = @@error
IF @error != 0 --fatal external error
    BEGIN
        ROLLBACK TRANSACTION @tranName
        COMMIT TRANSACTION
        SELECT @msg = 'External error in _Company$update procedure. ' + @msgTag + ' CALL=(UPDATE Company)>'
        RAISERROR 500001 @msg
        RETURN -100
    END
ELSE IF (@rowcount <> 1) --not primary key or row deleted
    BEGIN
        IF (@rowcount = 0)
            BEGIN --if row exists without the timestamp then row has been modified
                IF EXISTS (SELECT * FROM Company WHERE CompanyID = @CompanyID) 
                    BEGIN
                        SELECT @msg = 'The row has been modified by another user. '
                    END
                ELSE --row has been deleted
                    BEGIN
                        SELECT @msg = 'The record does not exist. '
                    END
            END
        ELSE --rowcount>0 so too many rows
            BEGIN
                SELECT @msg = 'Too many rows were modified.' 
            END
        --rollback and exit
        ROLLBACK TRANSACTION @tranName 
        COMMIT TRANSACTION
        SELECT @msg = @msg + @msgTag + ';CALL=(UPDATE Company)>'
        RAISERROR 50000 @msg
        RETURN -100
    END
--it's all good
COMMIT TRANSACTION
RETURN 0
GO

/********************************************************************
 * Code Generated by ViDAL Version 1.0
 * Create date: 21/10/2006 01:10:06
 **********************************************************************/
CREATE PROCEDURE _Company$delete 
  @CompanyID int, 
  @LastUpdate timestamp
 AS 
DECLARE @rowcount AS int,
        @error AS int,
        @msg AS varchar(255),
        @tranName AS sysname,
        @msgTag AS varchar(255)
-- set up error message tag and transaction name
SET @msgTag = '<' + object_name(@@procID) + ';TYPE=P;keyvalue=@CompanyID:' + CONVERT(varchar(10),@CompanyID) 
SET @tranName = object_name(@@procid) + CAST(@@nestlevel AS VARCHAR(2))
--make sure optimistic lock value is valid 
IF @LastUpdate IS NULL
    BEGIN
       SET @msg = 'The LastUpdate value must not be NULL' + @msgTag + '>'
       RAISERROR 50000 @msg
       RETURN -100
    END
BEGIN TRANSACTION
SAVE TRANSACTION @tranName
--start data delete
DELETE FROM Company
WHERE CompanyID = @CompanyID AND LastUpdate = @LastUpdate    
--get rowcount and error level
SELECT @rowcount = @@rowcount, @error = @@error
IF @error != 0 --fatal external error
    BEGIN
        ROLLBACK TRANSACTION @tranName
        COMMIT TRANSACTION
        SELECT @msg = 'External error in _Company$delete procedure. ' + @msgTag + ' CALL=(DELETE & Company)>'
        RAISERROR 500001 @msg
        RETURN -100
    END
ELSE IF (@rowcount <> 1) --not primary key or row deleted
    BEGIN
        IF (@rowcount = 0)
            BEGIN --if row exists without the timestamp then row has been modified
                IF EXISTS (SELECT * FROM Company WHERE CompanyID = @CompanyID) 
                    BEGIN
                        SELECT @msg = 'The row has been modified by another user. '
                    END
                ELSE --row has been deleted before
                    BEGIN
                        SELECT @msg = 'The record does not exist. '
                    END
            END
        ELSE --rowcount>0 so too many rows
            BEGIN
                SELECT @msg = 'Too many rows were deleted.' 
            END
        --rollback and exit
        ROLLBACK TRANSACTION @tranName 
        COMMIT TRANSACTION
        SELECT @msg = @msg + @msgTag + ';CALL=(DELETE Company)>'
        RAISERROR 50000 @msg
        RETURN -100
    END
--it's all good
COMMIT TRANSACTION
RETURN 0
GO
/********************************************************************
 * Code Generated by ViDAL Version 1.0
 * Create date: 21/10/2006 01:10:06
 **********************************************************************/
CREATE PROCEDURE _Company$select 
  @CompanyID int
 AS 
DECLARE @error AS int,
        @msg AS varchar(255),
        @msgTag AS varchar(255)
-- set up error message tag and transaction name
SET @msgTag = '<' + object_name(@@procID) + ';TYPE=P;keyvalue=@CompanyID:' + CONVERT(varchar(10),@CompanyID) 
--start data select
SELECT * FROM Company
WHERE CompanyID = @CompanyID
--get error level
SELECT @error = @@error
IF @error != 0 --fatal external error
    BEGIN
        SELECT @msg = 'External error in _Company$select procedure. ' + @msgTag + ' CALL=(SELECT Company)>'
        RAISERROR 500001 @msg
        RETURN -100
    END
GO
 
ooops I just noticed in your profile you are listed as a beginner - you may find the above a bit heavy going - to say the least.

If this is the case and you are still keen to explore this subject I will try and simplify my classes for you. Let me know.
 
thanks for ur program and helping.

i'm beginner to vb.net but not to the world of programming, i got good experience in VB6, even i read VB.NET, now i started to do application in vb.net so i wanted to have good base for my start, hope u give good support to me to start/continue application development using oops concept.

one more thing i observed in ur program, whatever columns in the database table (Company) u r treating as a class, i feel since we've already created tables in database again same tables are treating as class don't u think it is rework, coz if database is of morethan 50 r 100 tables is there , then creating classes for all the table is time consuming and it's rework.

please suggest me regarding my doubt and if my doubt is wrong please correct me in proper understanding of the concept.

with regards
 
one more thing i observed in ur program, whatever columns in the database table (Company) u r treating as a class, i feel since we've already created tables in database again same tables are treating as class don't u think it is rework, coz if database is of morethan 50 r 100 tables is there , then creating classes for all the table is time consuming and it's rework.

Yes - to type all this code is a lot of work - I wrote a program to access the database schema and generates all of the classes and strored procedures.

I can guess your next question: Can I have a copy of the source code? - Sorry no, it might still form part of a commercial release however with the following code snippets and the samples above you should be able to write your own:

VB.NET:
'Get list of tables in schema in conn string
[SIZE=2]cmd = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlCommand([/SIZE][SIZE=2][COLOR=#800000]"SELECT * FROM sys.objects WHERE type='U'"[/COLOR][/SIZE][SIZE=2], cnn)
[/SIZE] 
'Get column information
[SIZE=2]cmdField = [/SIZE][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][SIZE=2] SqlCommand([/SIZE][SIZE=2][COLOR=#800000]"SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME= '"[/COLOR][/SIZE][SIZE=2] & TableName & [/SIZE][SIZE=2][COLOR=#800000]"' "[/COLOR][/SIZE][SIZE=2], cnnField)[/SIZE]
[SIZE=2] 
[/SIZE]

If it doesn't get released I will be publishing it on CodeProject in early next January - search for ViDAL there.
 
:)

don't worry i don't ask so much help from u. whatever i'm getting help from u and vbdontnetforums is really great.

i come back again...

bye for now
 
Back
Top