Jump to content
Xtreme .Net Talk

Krijn

Members
  • Posts

    14
  • Joined

  • Last visited

Everything posted by Krijn

  1. An example for this problemtestserverobjects.zip
  2. Hello, I have a server - application (windows service) with 40 wellknown remote objects. All of these objects expose Get and Save methods witch return and accept only datasets (or integer,strings, ..). Because the methods or very small (select from a DB) the application works fine with singletons. When I put a While block (for 30 seconds) inside a DB-transaction all the clients are waiting for this transaction (testing purpose). This is normal because each client uses the same object (singleton), but when I change the singletons to singleclasses the result is still the same ? Does somebody know what I'm doing wrong ?
  3. Hi, I really don't think this is the right answer in .NET. Maybe it would be correct in vb6 but this is totally not compatible with the OO - language where .NET stands for. To do it in a more .NET way I suggest you create some events for setting some text in the second form. example : Public Event MustSetText(Sender as object, Msg as string) In the button click event off your second form raise the event : Raise event MustSetText(Me, "Hi from form2!") Then catch the event in the first form On_Form2_MustSetText(Sender as object, Msg as string) Me.textBox1.text = Msg
  4. Some code Hi, In attached zip file there is an example vb project wich explains my problem. The databinding on rows failes whenever you have a dbnull value in the row. What I need is a global solution for this problem. Of course I can set the fields empty bfore binding the row, but that is not the answer for the usage in the future. Greetings testfillinvb.zip
  5. Hello, My problem is the following. I have a main form with controls bound to a dataset. When adding a new item for the dataset a new form is shown for filling in the correct values. What is the best way for databinding the fill in form without loosing the current position in the main forms dataset. Thanks
  6. Hello, I have a large visual basic distributed application with 25 projects. How can I open one of these projects without losing my references and still use project-to-project references in the 'main' etp ? Thanks
  7. Hi, For heiko : i use SetColumnError on the datarow. But you are right: the problem was somewhere else. I've set databindings manually with something like next line : textBox1.databindings.add("Text",Me.dataSet1.Table1,"Column_name") This works.., but not for an errorprovider. Solution : Textbox1.databindings.add("Text",Me.dataSet1,"Table1.column_name") Think there is still work to do for microsoft ! Thanks all Greetings Krijn
  8. Yes, but the only components that implement icontainercontrol are Form, Usercontrol. Errorprovider.containercontrol = Tabpage gives following error: ' Tabpage cannot be converted to containercontrol ' Greetings Krijn
  9. Hello, Has anyone tried to use the errorprovider in a tabcontrol using columnerrors in datarows ? I think I doesn't work. Is it because Tabcontrol doesn't implement Icontainercontrol ? I've created a custom tabcontrol witch implements Icontainercontrol but when I set the property .net gives errors. Greetings Krijn
  10. Real code example Datasource : 3 dataTables Form : 3 textboxes, each binded to one datatable, + 2 buttons Merge doesn't work after clicking button2 ?? Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim System As New Aanvraagsystem() Dim tempds As New Aanvraagdata() tempds = System.GetbyDossierId(1) Me.dsAanvraagdata.Merge(tempds, False) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox3.DataBindings("Text").BindingManagerBase.EndCurrentEdit() If Me.dsAanvraagdata.GetChanges Is Nothing Then MessageBox.Show("False") Else MessageBox.Show("True") MessageBox.Show(Me.dsAanvraagdata.Labelpunten.LabelpuntRow(0).plaats) End If End Sub Private Sub TextBox3_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox3.Enter If TextBox3.DataBindings("Text").BindingManagerBase.Count = 0 Then TextBox3.DataBindings("Text").BindingManagerBase.AddNew() End If End Sub Please use tags [/vb ] around your code.[/color]
  11. Thanks, But it is not working all the time. Problem : I have a dataset with 4 tables, 3 of them are only allowed to have maximum one single row. I've managed to use the currencymanager for single row tables but when I have to add a new row things go badly wrong. Situation: 1 textbox (txtone) In the Enter_event following code: Dim Mbase As BindingManagerBase = Me.BindingContext(Me.dsAanvraagdata, "Dossiers.labelpunt") If Mbase.Count = 0 Then Dim nrow As Rows.LabelpuntRow = _ Me.dsAanvraagdata.Labelpunten.NewLabelpuntRow nrow.SetParentRow(Me.dsAanvraagdata.Dossiers.DossierRow(0)) Me.dsAanvraagdata.Labelpunten.AddRow(nrow) Mbase.Position = 0 Dim cm As CurrencyManager = CType(Mbase, CurrencyManager) cm.Refresh() End If in Leave_event : Dim Mbase As BindingManagerBase = Me.BindingContext(Me.dsAanvraagdata.Tables("LabelPunten")) Dim cm As CurrencyManager = CType(Mbase, CurrencyManager) cm.EndCurrentEdit() When I enter and leave the textbox several times the text property clears itself although the text is saved in the dataset. The events of RowChanged are also not fired when I change the text. Greetings
  12. Hi, Does somebody know about this problem : I have two textbox controls witch I want to bind to my datasource (this contains only one row). I can edit the record (with beginEdit and EndEdit), but when I post 'rejectchanges' to the dataset the binding doesn't seem to affect the changes back to my textboxes. PS : When is the best time for setting BeginEdit. Do I have to set this in every Onclick event of my textboxes ? Thanks
  13. Found it. When you override function 'ShouldSerializeRelations' and return false, the problem is solved.
  14. Hello, I've managed to manually create datatables (with added functionality). Now I can create my own datasets (with my datatables) and use this as a component on a winform. But VS.NET does some weird things. He keeps adding the relations from the dataset in the 'Designer generated code' block. Then he complaints : 'A Relation named 'FKProjectTables' already belongs to this DataSet'. My Dataset looks like this : public sub ds inherits dataset public a as datatable public b as datatable public sub new() public FKProjectTables as DataRelation mybase.new() a = new datatable b = new datatable FKProjectTables = New DataRelation( ...) End Sub Greetings, Krijn
×
×
  • Create New...