W
Woody Splawn
I am trying to understand how VS does things with regard to calculated
fields. I would like to have a name field in a txtBox on a form that
consists of the firstName and lastName fields glued together. In the
environment I am used to you would place a calculated field on the form and
call it Name. It would contain a formula like "Fname + ' '+Lname".
If I understand things correctly, VS does the same thing by use of
expressions. I discovered some code that places the glued value into a
*ListBox* on a form. But I am unable to discover how, if it is possible, to
place the glued value into just a textbox on the form. I am not sure if the
Expression ability of VS is made to work this way or not but given the code
below that works for a list box, is it possible to change it and make it
place the glued value into a Text box instead. If so what is the correct
syntax? I have the code below in a button on a form.
Dim dcName As DataColumn
dcName = New DataColumn("Name")
dcName.DataType = System.Type.GetType("System.String")
dcName.Expression = "FirstName+ ' ' + LastNamet"
Me.DsCompanys1.Tables("Companys").Columns.Add(dcName)
Me.ListBox1.DataSource = Me.DsCompanys1.Tables("Companys")
Me.ListBox1.DisplayMember = "Name"
fields. I would like to have a name field in a txtBox on a form that
consists of the firstName and lastName fields glued together. In the
environment I am used to you would place a calculated field on the form and
call it Name. It would contain a formula like "Fname + ' '+Lname".
If I understand things correctly, VS does the same thing by use of
expressions. I discovered some code that places the glued value into a
*ListBox* on a form. But I am unable to discover how, if it is possible, to
place the glued value into just a textbox on the form. I am not sure if the
Expression ability of VS is made to work this way or not but given the code
below that works for a list box, is it possible to change it and make it
place the glued value into a Text box instead. If so what is the correct
syntax? I have the code below in a button on a form.
Dim dcName As DataColumn
dcName = New DataColumn("Name")
dcName.DataType = System.Type.GetType("System.String")
dcName.Expression = "FirstName+ ' ' + LastNamet"
Me.DsCompanys1.Tables("Companys").Columns.Add(dcName)
Me.ListBox1.DataSource = Me.DsCompanys1.Tables("Companys")
Me.ListBox1.DisplayMember = "Name"