
unit WebForm1;

interface

uses
  System.Collections, System.ComponentModel,
  System.Data, System.Drawing, System.Web, System.Web.SessionState,
  System.Web.UI, System.Web.UI.WebControls, System.Web.UI.HtmlControls,
  Borland.Data.Provider, System.Globalization, Borland.Data.Common,
  Borland.Data.Web;

type
  TWebForm1 = class(System.Web.UI.Page)
  {$REGION 'Designer Managed Code'}
  strict private
    procedure InitializeComponent;
		procedure ListBox1_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);
		procedure DBWebDataSource1_OnApplyChangesRequest(sender: System.Object; e: Borland.Data.Web.WebControlEventArgs);
		procedure TWebForm1_PreRender(sender: System.Object; e: System.EventArgs);
		procedure ListBox1_PreRender(sender: System.Object; e: System.EventArgs);
		procedure ListBox1_Load(sender: System.Object; e: System.EventArgs);
  {$ENDREGION}
  strict private
    procedure Page_Load(sender: System.Object; e: System.EventArgs);

  strict protected
		BdpConnection1: Borland.Data.Provider.BdpConnection;
		bdpSelectCommand1: Borland.Data.Provider.BdpCommand;
		bdpInsertCommand1: Borland.Data.Provider.BdpCommand;
		bdpUpdateCommand1: Borland.Data.Provider.BdpCommand;
		bdpDeleteCommand1: Borland.Data.Provider.BdpCommand;
		CountryDataAdapter: Borland.Data.Provider.BdpDataAdapter;
		bdpSelectCommand2: Borland.Data.Provider.BdpCommand;
		bdpInsertCommand2: Borland.Data.Provider.BdpCommand;
		bdpUpdateCommand2: Borland.Data.Provider.BdpCommand;
		bdpDeleteCommand2: Borland.Data.Provider.BdpCommand;
		TravelPicturesDataAdapter: Borland.Data.Provider.BdpDataAdapter;
		CountryDs: System.Data.DataSet;
		DataTable1: System.Data.DataTable;
		DataColumn1: System.Data.DataColumn;
		DataColumn2: System.Data.DataColumn;
		DataColumn3: System.Data.DataColumn;
		DataColumn4: System.Data.DataColumn;
		DataColumn5: System.Data.DataColumn;
		DataTable2: System.Data.DataTable;
		DataColumn6: System.Data.DataColumn;
		DataColumn7: System.Data.DataColumn;
		DataColumn8: System.Data.DataColumn;
		DataColumn9: System.Data.DataColumn;
		DataColumn10: System.Data.DataColumn;
		DataColumn11: System.Data.DataColumn;
		DBWebDataSource1: Borland.Data.Web.DBWebDataSource;
		DBWebGrid1: Borland.Data.Web.DBWebGrid;
		DBWebNavigator2: Borland.Data.Web.DBWebNavigator;
		DBWebImage1: Borland.Data.Web.DBWebImage;
		DataView1: System.Data.DataView;
		ListBox1: System.Web.UI.WebControls.ListBox;
		DBWebGrid2: Borland.Data.Web.DBWebGrid;
    procedure OnInit(e: EventArgs); override;
  public
//    public void LoadPostBackData(postValue: string; postCollection: NameValueCollection);
  end;

implementation

{$REGION 'Designer Managed Code'}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWebForm1.InitializeComponent;
type
	TSystem_Data_DataRelationArray = array of System.Data.DataRelation;
	TstringArray = array of string;
	TSystem_Data_DataTableArray = array of System.Data.DataTable;
	TSystem_Data_DataColumnArray = array of System.Data.DataColumn;
	TSystem_Data_ConstraintArray = array of System.Data.Constraint;
	TArrayOfByte = array of Byte;
	TArrayOfWideChar = array of WideChar;
begin
	Self.BdpConnection1 := Borland.Data.Provider.BdpConnection.Create;
	Self.bdpSelectCommand1 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpInsertCommand1 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpUpdateCommand1 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpDeleteCommand1 := Borland.Data.Provider.BdpCommand.Create;
	Self.CountryDataAdapter := Borland.Data.Provider.BdpDataAdapter.Create;
	Self.CountryDs := System.Data.DataSet.Create;
	Self.DataTable1 := System.Data.DataTable.Create;
	Self.DataColumn1 := System.Data.DataColumn.Create;
	Self.DataColumn2 := System.Data.DataColumn.Create;
	Self.DataColumn3 := System.Data.DataColumn.Create;
	Self.DataColumn4 := System.Data.DataColumn.Create;
	Self.DataColumn5 := System.Data.DataColumn.Create;
	Self.DataTable2 := System.Data.DataTable.Create;
	Self.DataColumn6 := System.Data.DataColumn.Create;
	Self.DataColumn7 := System.Data.DataColumn.Create;
	Self.DataColumn8 := System.Data.DataColumn.Create;
	Self.DataColumn9 := System.Data.DataColumn.Create;
	Self.DataColumn10 := System.Data.DataColumn.Create;
	Self.DataColumn11 := System.Data.DataColumn.Create;
	Self.bdpSelectCommand2 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpInsertCommand2 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpUpdateCommand2 := Borland.Data.Provider.BdpCommand.Create;
	Self.bdpDeleteCommand2 := Borland.Data.Provider.BdpCommand.Create;
	Self.TravelPicturesDataAdapter := Borland.Data.Provider.BdpDataAdapter.Create;
	Self.DBWebDataSource1 := Borland.Data.Web.DBWebDataSource.Create;
	Self.DataView1 := System.Data.DataView.Create;
	(System.ComponentModel.ISupportInitialize(Self.CountryDataAdapter)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.CountryDs)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.DataTable1)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.DataTable2)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.TravelPicturesDataAdapter)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.DBWebDataSource1)).BeginInit;
	(System.ComponentModel.ISupportInitialize(Self.DataView1)).BeginInit;
	Include(Self.ListBox1.Load, Self.ListBox1_Load);
	Include(Self.ListBox1.SelectedIndexChanged, Self.ListBox1_SelectedIndexChanged);
	Include(Self.ListBox1.PreRender, Self.ListBox1_PreRender);
	// 
	// BdpConnection1
	// 
	Self.BdpConnection1.ConnectionOptions := 'waitonlocks=False;commitretain=False;sqldialect=3;transaction isolation=ReadCom'+ 
  'mitted;servercharset=;rolename=myrole';
	Self.BdpConnection1.ConnectionString := 'assembly=Borland.Data.Interbase, Version=1.5.0.0, Culture=neutral, PublicKeyTok'+ 
  'en=91d62ebb5b0d1b1b;vendorclient=gds32.dll;'+ 
  'provider=Interbase;username=sysdba;password=masterkey';
	// 
	// bdpSelectCommand1
	// 
	Self.bdpSelectCommand1.CommandOptions := nil;
	Self.bdpSelectCommand1.CommandText := 'SELECT NAME, CAPITAL, CONTINENT, AREA, POPULATION FROM COUNTRY ORDER BY NAME';
	Self.bdpSelectCommand1.CommandType := System.Data.CommandType.Text;
	Self.bdpSelectCommand1.Connection := Self.BdpConnection1;
	Self.bdpSelectCommand1.ParameterCount := (SmallInt(0));
	Self.bdpSelectCommand1.SchemaName := nil;
	Self.bdpSelectCommand1.Transaction := nil;
	Self.bdpSelectCommand1.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpInsertCommand1
	// 
	Self.bdpInsertCommand1.CommandOptions := nil;
	Self.bdpInsertCommand1.CommandText := 'INSERT INTO COUNTRY (NAME, CAPITAL, CONTINENT, AREA, POPULATION ) VALUES ( ?, ?'+ 
  ', ?, ?, ?)';
	Self.bdpInsertCommand1.CommandType := System.Data.CommandType.Text;
	Self.bdpInsertCommand1.Connection := Self.BdpConnection1;
	Self.bdpInsertCommand1.ParameterCount := (SmallInt(5));
	Self.bdpInsertCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NAME', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'NAME', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CAPITAL', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CAPITAL', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CONTINENT', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CONTINENT', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('AREA', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'AREA', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('POPULATION', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'POPULATION', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand1.SchemaName := nil;
	Self.bdpInsertCommand1.Transaction := nil;
	Self.bdpInsertCommand1.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpUpdateCommand1
	// 
	Self.bdpUpdateCommand1.CommandOptions := nil;
	Self.bdpUpdateCommand1.CommandText := 'UPDATE COUNTRY SET NAME = ?, CAPITAL = ?, CONTINENT = ?, AREA = ?, POPULATION ='+ 
  ' ? WHERE NAME = ? AND CAPITAL = ? AND CONTINENT = ? AND AREA = ? AND POPULATIO'+ 
  'N = ?';
	Self.bdpUpdateCommand1.CommandType := System.Data.CommandType.Text;
	Self.bdpUpdateCommand1.Connection := Self.BdpConnection1;
	Self.bdpUpdateCommand1.ParameterCount := (SmallInt(10));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NAME', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'NAME', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CAPITAL', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CAPITAL', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CONTINENT', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CONTINENT', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('AREA', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'AREA', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('POPULATION', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'POPULATION', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NAMEOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'NAME', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CAPITALOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CAPITAL', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CONTINENTOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CONTINENT', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('AREAOriginal', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'AREA', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('POPULATIONOriginal', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'POPULATION', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand1.SchemaName := nil;
	Self.bdpUpdateCommand1.Transaction := nil;
	Self.bdpUpdateCommand1.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpDeleteCommand1
	// 
	Self.bdpDeleteCommand1.CommandOptions := nil;
	Self.bdpDeleteCommand1.CommandText := 'DELETE FROM COUNTRY WHERE NAME = ? AND CAPITAL = ? AND CONTINENT = ? AND AREA ='+ 
  ' ? AND POPULATION = ?';
	Self.bdpDeleteCommand1.CommandType := System.Data.CommandType.Text;
	Self.bdpDeleteCommand1.Connection := Self.BdpConnection1;
	Self.bdpDeleteCommand1.ParameterCount := (SmallInt(5));
	Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NAMEOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'NAME', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CAPITALOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CAPITAL', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('CONTINENTOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(24)), (Byte(0)), 24, 'CONTINENT', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('AREAOriginal', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'AREA', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand1.Parameters.Add(Borland.Data.Common.BdpParameter.Create('POPULATIONOriginal', Borland.Data.Common.BdpType.Double, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'POPULATION', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand1.SchemaName := nil;
	Self.bdpDeleteCommand1.Transaction := nil;
	Self.bdpDeleteCommand1.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// CountryDataAdapter
	// 
	Self.CountryDataAdapter.Active := True;
	Self.CountryDataAdapter.DataSet := Self.CountryDs;
	Self.CountryDataAdapter.DataTable := Self.DataTable1;
	Self.CountryDataAdapter.DeleteCommand := Self.bdpDeleteCommand1;
	Self.CountryDataAdapter.InsertCommand := Self.bdpInsertCommand1;
	Self.CountryDataAdapter.SelectCommand := Self.bdpSelectCommand1;
	Self.CountryDataAdapter.StartRecord := 0;
	Self.CountryDataAdapter.UpdateCommand := Self.bdpUpdateCommand1;
	// 
	// CountryDs
	// 
	Self.CountryDs.DataSetName := 'NewDataSet';
	Self.CountryDs.Locale := System.Globalization.CultureInfo.Create('en-US');
	Self.CountryDs.Relations.AddRange(TSystem_Data_DataRelationArray.Create(System.Data.DataRelation.Create('Relation1', 'Table1', 'Table2', TstringArray.Create('NAME'), TstringArray.Create('COUNTRY'), False)));
	Self.CountryDs.Tables.AddRange(TSystem_Data_DataTableArray.Create(Self.DataTable1, Self.DataTable2));
	// 
	// DataTable1
	// 
	Self.DataTable1.Columns.AddRange(TSystem_Data_DataColumnArray.Create(Self.DataColumn1, Self.DataColumn2, Self.DataColumn3, Self.DataColumn4, Self.DataColumn5));
	Self.DataTable1.Constraints.AddRange(TSystem_Data_ConstraintArray.Create(System.Data.UniqueConstraint.Create('Constraint1', TstringArray.Create('NAME'), False)));
	Self.DataTable1.TableName := 'Table1';
	// 
	// DataColumn1
	// 
	Self.DataColumn1.ColumnName := 'NAME';
	// 
	// DataColumn2
	// 
	Self.DataColumn2.ColumnName := 'CAPITAL';
	// 
	// DataColumn3
	// 
	Self.DataColumn3.ColumnName := 'CONTINENT';
	// 
	// DataColumn4
	// 
	Self.DataColumn4.ColumnName := 'AREA';
	Self.DataColumn4.DataType := TypeOf(System.Double);
	// 
	// DataColumn5
	// 
	Self.DataColumn5.ColumnName := 'POPULATION';
	Self.DataColumn5.DataType := TypeOf(System.Double);
	// 
	// DataTable2
	// 
	Self.DataTable2.Columns.AddRange(TSystem_Data_DataColumnArray.Create(Self.DataColumn6, Self.DataColumn7, Self.DataColumn8, Self.DataColumn9, Self.DataColumn10, Self.DataColumn11));
	Self.DataTable2.Constraints.AddRange(TSystem_Data_ConstraintArray.Create(System.Data.ForeignKeyConstraint.Create('Relation1', 'Table1', TstringArray.Create('NAME'), TstringArray.Create('COUNTRY'), System.Data.AcceptRejectRule.None, System.Data.Rule.Cascade, System.Data.Rule.Cascade)));
	Self.DataTable2.TableName := 'Table2';
	// 
	// DataColumn6
	// 
	Self.DataColumn6.ColumnName := 'PICTNO';
	Self.DataColumn6.DataType := TypeOf(Integer);
	// 
	// DataColumn7
	// 
	Self.DataColumn7.ColumnName := 'COUNTRY';
	// 
	// DataColumn8
	// 
	Self.DataColumn8.ColumnName := 'YEARTAKEN';
	Self.DataColumn8.DataType := TypeOf(Integer);
	// 
	// DataColumn9
	// 
	Self.DataColumn9.ColumnName := 'DESCRIPTION';
	// 
	// DataColumn10
	// 
	Self.DataColumn10.ColumnName := 'BMP';
	Self.DataColumn10.DataType := TypeOf(TArrayOfByte);
	// 
	// DataColumn11
	// 
	Self.DataColumn11.ColumnName := 'NOTES';
	Self.DataColumn11.DataType := TypeOf(TArrayOfWideChar);
	// 
	// bdpSelectCommand2
	// 
	Self.bdpSelectCommand2.CommandOptions := nil;
	Self.bdpSelectCommand2.CommandText := 'SELECT PICTNO, COUNTRY, YEARTAKEN, DESCRIPTION, BMP, NOTES FROM TRAVELLOG ORDER'+ 
  ' BY PICTNO';
	Self.bdpSelectCommand2.CommandType := System.Data.CommandType.Text;
	Self.bdpSelectCommand2.Connection := Self.BdpConnection1;
	Self.bdpSelectCommand2.ParameterCount := (SmallInt(0));
	Self.bdpSelectCommand2.SchemaName := nil;
	Self.bdpSelectCommand2.Transaction := nil;
	Self.bdpSelectCommand2.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpInsertCommand2
	// 
	Self.bdpInsertCommand2.CommandOptions := nil;
	Self.bdpInsertCommand2.CommandText := 'INSERT INTO TRAVELLOG (PICTNO, COUNTRY, YEARTAKEN, DESCRIPTION, BMP, NOTES ) VA'+ 
  'LUES ( ?, ?, ?, ?, ?, ?)';
	Self.bdpInsertCommand2.CommandType := System.Data.CommandType.Text;
	Self.bdpInsertCommand2.Connection := Self.BdpConnection1;
	Self.bdpInsertCommand2.ParameterCount := (SmallInt(6));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('PICTNO', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'PICTNO', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('COUNTRY', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(15)), (Byte(0)), 15, 'COUNTRY', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('YEARTAKEN', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'YEARTAKEN', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('DESCRIPTION', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(30)), (Byte(0)), 30, 'DESCRIPTION', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('BMP', Borland.Data.Common.BdpType.Blob, Borland.Data.Common.BdpType.stMemo, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'BMP', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NOTES', Borland.Data.Common.BdpType.Blob, Borland.Data.Common.BdpType.stBinary, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'NOTES', System.Data.DataRowVersion.Current, nil));
	Self.bdpInsertCommand2.SchemaName := nil;
	Self.bdpInsertCommand2.Transaction := nil;
	Self.bdpInsertCommand2.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpUpdateCommand2
	// 
	Self.bdpUpdateCommand2.CommandOptions := nil;
	Self.bdpUpdateCommand2.CommandText := 'UPDATE TRAVELLOG SET PICTNO = ?, COUNTRY = ?, YEARTAKEN = ?, DESCRIPTION = ?, B'+ 
  'MP = ?, NOTES = ? WHERE PICTNO = ? AND COUNTRY = ? AND YEARTAKEN = ? AND DESCR'+ 
  'IPTION = ?';
	Self.bdpUpdateCommand2.CommandType := System.Data.CommandType.Text;
	Self.bdpUpdateCommand2.Connection := Self.BdpConnection1;
	Self.bdpUpdateCommand2.ParameterCount := (SmallInt(10));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('PICTNO', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'PICTNO', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('COUNTRY', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(15)), (Byte(0)), 15, 'COUNTRY', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('YEARTAKEN', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'YEARTAKEN', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('DESCRIPTION', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(30)), (Byte(0)), 30, 'DESCRIPTION', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('BMP', Borland.Data.Common.BdpType.Blob, Borland.Data.Common.BdpType.stMemo, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'BMP', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('NOTES', Borland.Data.Common.BdpType.Blob, Borland.Data.Common.BdpType.stBinary, 0, System.Data.ParameterDirection.Input, False, (Byte(8)), (Byte(0)), 8, 'NOTES', System.Data.DataRowVersion.Current, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('PICTNOOriginal', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'PICTNO', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('COUNTRYOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(15)), (Byte(0)), 15, 'COUNTRY', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('YEARTAKENOriginal', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'YEARTAKEN', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('DESCRIPTIONOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(30)), (Byte(0)), 30, 'DESCRIPTION', System.Data.DataRowVersion.Original, nil));
	Self.bdpUpdateCommand2.SchemaName := nil;
	Self.bdpUpdateCommand2.Transaction := nil;
	Self.bdpUpdateCommand2.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// bdpDeleteCommand2
	// 
	Self.bdpDeleteCommand2.CommandOptions := nil;
	Self.bdpDeleteCommand2.CommandText := 'DELETE FROM TRAVELLOG WHERE PICTNO = ? AND COUNTRY = ? AND YEARTAKEN = ? AND DE'+ 
  'SCRIPTION = ?';
	Self.bdpDeleteCommand2.CommandType := System.Data.CommandType.Text;
	Self.bdpDeleteCommand2.Connection := Self.BdpConnection1;
	Self.bdpDeleteCommand2.ParameterCount := (SmallInt(4));
	Self.bdpDeleteCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('PICTNOOriginal', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'PICTNO', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('COUNTRYOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(15)), (Byte(0)), 15, 'COUNTRY', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('YEARTAKENOriginal', Borland.Data.Common.BdpType.Int32, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(4)), (Byte(0)), 4, 'YEARTAKEN', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand2.Parameters.Add(Borland.Data.Common.BdpParameter.Create('DESCRIPTIONOriginal', Borland.Data.Common.BdpType.&String, Borland.Data.Common.BdpType.Unknown, 0, System.Data.ParameterDirection.Input, False, (Byte(30)), (Byte(0)), 30, 'DESCRIPTION', System.Data.DataRowVersion.Original, nil));
	Self.bdpDeleteCommand2.SchemaName := nil;
	Self.bdpDeleteCommand2.Transaction := nil;
	Self.bdpDeleteCommand2.UpdatedRowSource := System.Data.UpdateRowSource.None;
	// 
	// TravelPicturesDataAdapter
	// 
	Self.TravelPicturesDataAdapter.Active := True;
	Self.TravelPicturesDataAdapter.DataSet := Self.CountryDs;
	Self.TravelPicturesDataAdapter.DataTable := Self.DataTable2;
	Self.TravelPicturesDataAdapter.DeleteCommand := Self.bdpDeleteCommand2;
	Self.TravelPicturesDataAdapter.InsertCommand := Self.bdpInsertCommand2;
	Self.TravelPicturesDataAdapter.MaxRecords := 1000;
	Self.TravelPicturesDataAdapter.SelectCommand := Self.bdpSelectCommand2;
	Self.TravelPicturesDataAdapter.StartRecord := 0;
	Self.TravelPicturesDataAdapter.UpdateCommand := Self.bdpUpdateCommand2;
	// 
	// DBWebDataSource1
	// 
	Self.DBWebDataSource1.DataSource := Self.DataView1;
	Self.DBWebDataSource1.ErrorDlgBackColor := System.Drawing.Color.Azure;
	Self.DBWebDataSource1.ErrorDlgBorderColor := System.Drawing.Color.Red;
	Self.DBWebDataSource1.ErrorDlgForeColor := System.Drawing.Color.Black;
	Include(Self.DBWebDataSource1.OnApplyChangesRequest, Self.DBWebDataSource1_OnApplyChangesRequest);
	// 
	// DataView1
	// 
	Self.DataView1.RowFilter := 'NAME = ''SPAIN''';
	Self.DataView1.Table := Self.DataTable1;
	Include(Self.Load, Self.Page_Load);
	Include(Self.PreRender, Self.TWebForm1_PreRender);
	(System.ComponentModel.ISupportInitialize(Self.CountryDataAdapter)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.CountryDs)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.DataTable1)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.DataTable2)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.TravelPicturesDataAdapter)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.DBWebDataSource1)).EndInit;
	(System.ComponentModel.ISupportInitialize(Self.DataView1)).EndInit;
end;
{$ENDREGION}

procedure TWebForm1.Page_Load(sender: System.Object; e: System.EventArgs);
var
  DSource: IDBDataSource;
  CurrentCountry: string;
  item: ListItem;
  o: System.Object;
  sCurrentFilter, sFilter: string;
begin
  if not IsPostBack  then
  begin
    ListBox1.DataBind();
    if DBWebDataSource1 is IDBDataSource then
    begin
      DSource :=  DBWebDataSource1 as IDBDataSource;
      CurrentCountry := Convert.ToString(DSource.GetColumnValue(Page, 'Table2', 'COUNTRY'));
      if Assigned(CurrentCountry) then
      begin
        item := ListBox1.Items.FindByText(CurrentCountry);
        ListBox1.SelectedIndex := Listbox1.Items.IndexOf(item);
      end;
    end;
  end else
  begin
    o := Page.Session['CurrentFilter'];
    if not Assigned(o) then
      sCurrentFilter := ''
    else
      sCurrentFilter := Convert.ToString(o);
    sFilter := 'NAME = ' + '''' + ListBox1.SelectedValue + '''';
    DataView1.RowFilter := sFilter;
    if (sCurrentFilter <> '') and (sCurrentFilter <> sFilter) then
    begin
      Page.Session['CurrentFilter'] := sFilter;
      DBWebDataSource1.ClearSessionChanges(Page);
    end else
    if sCurrentFilter = '' then
      Page.Session['CurrentFilter'] := sFilter;
  end;
end;

procedure TWebForm1.OnInit(e: EventArgs);
begin
  //
  // CODEGEN: This call is required by the ASP.NET Web Form Designer.
  //
  InitializeComponent;
  inherited OnInit(e);
end;

procedure TWebForm1.ListBox1_Load(sender: System.Object; e: System.EventArgs);
begin
end;

procedure TWebForm1.ListBox1_PreRender(sender: System.Object; e: System.EventArgs);
begin
end;

procedure TWebForm1.TWebForm1_PreRender(sender: System.Object; e: System.EventArgs);
begin
end;

procedure TWebForm1.DBWebDataSource1_OnApplyChangesRequest(sender: System.Object;
		e: Borland.Data.Web.WebControlEventArgs);
begin
        TravelPicturesDataAdapter.AutoUpdate(BdpUpdateMode.Key);
end;

procedure TWebForm1.ListBox1_SelectedIndexChanged(sender: System.Object; e: System.EventArgs);
begin
end;


end.

