Cathi:
I try your example of regex.replace but when I try to add the biding to the textbox control it said did not accept null values. Before I try to add the databidings to the control I create the row and add the row to the dataset and also add some values to the field that was defined as no nulls.
The following line is where I get the problem.
Me.TextBox2.DataBindings.Add(SocSecNum)
socsecnum was declared in the following line.
Dim SocSecNum As New Binding("text", ObjDatos_personales_sol1, "Datos_personales_sol.num_control")
and the code that initialize the row for the dataset is the following
Me.BindingContext(ObjDatos_personales_sol1, "Datos_personales_sol").EndCurrentEdit()
dr = ObjDatos_personales_sol1.Tables(0).NewRow()
dr(0) = Space(1)
dr(3) = Space(1)
dr(4) = Space(1)
ObjDatos_personales_sol1.Tables(0).Rows.Add(dr)
Me.BindingContext(ObjDatos_personales_sol1, "Datos_personales_sol").Position = ObjDatos_personales_sol1.Tables(0).Rows.Count - 1
All that ocurred before adding the socsecnum object to the text box.
what I am doing wrong?