Greetings,
I have a vb.net application, which has a textbox (textbox1). I am trying to use the databindings of this textbox to bind it to an entity, created with llblgen.
The data is shown in the textbox normally, but when I try to change this data, is jumps back to the initial data when I change focus to another object.
I am using the following code:
Private Sub setDataLoggerBindings()
' DataLogger bindings
With frmEquipment.GlobalForm
If .selEntity.DataLogger_.Count > 0 Then
Me.TextBox1.DataBindings.Clear()
Dim b As New Binding("Text", .selEntity.DataLogger_(0), "MachineNumber")
Me.Textbox1.DataBindings.Add(b)
End If
End With
End Sub
Is there some setting I need to adjust to be able to get the value to the entity?
I am using the following setup:
version:
LLBLGen Pro 2.6 Final (October 6th, 2008 ) (no specific buildnr is mentioned)
runTime library version:
2.6.9.116
Template group:
SelfServicing
Target language:
VB.NET 3.5
Database:
Microsoft SQL Server 2005 - 9.00.4035.00 (Intel X86)
Nov 24 2008 13:01:59
Copyright (c) 1988-2005 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 2)
selEntity is an entity base on a record of the table Equipment, which has the following structure:
CREATE TABLE [dbo].[Equipment](
[EquipmentID] [int] IDENTITY(0,1) NOT NULL,
[DataLogger] [bit] NULL CONSTRAINT [DF_Equipment_DataLogger] DEFAULT ((0)),
[MainEquipment] [int] NULL CONSTRAINT [DF_Equipment_MainEquipment] DEFAULT ((0)),
CONSTRAINT [PK_Equipment] PRIMARY KEY CLUSTERED
(
[EquipmentID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Equipment] WITH CHECK ADD CONSTRAINT [FK_Equipment_Equipment] FOREIGN KEY([MainEquipment])
REFERENCES [dbo].[Equipment] ([EquipmentID])
GO
ALTER TABLE [dbo].[Equipment] CHECK CONSTRAINT [FK_Equipment_Equipment]
datalogger(0)_ is an entity based on a record of the table DataLogger, which has the following structure:
CREATE TABLE [dbo].[DataLogger](
[DataLoggerID] [int] IDENTITY(0,1) NOT NULL,
[EquipmentID] [int] NULL,
[MachineNumber] [int] NULL,
CONSTRAINT [PK_Machine] PRIMARY KEY CLUSTERED
(
[DataLoggerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DataLogger] WITH CHECK ADD CONSTRAINT [FK_Machine_Equipment] FOREIGN KEY([EquipmentID])
REFERENCES [dbo].[Equipment] ([EquipmentID])
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[DataLogger] CHECK CONSTRAINT [FK_Machine_Equipment]