G
Guest
Good day, I hoping someone can help me with a problem that I have. I'm trying
to update a dataset then my datasource using the sqlcommandbuilder in vb.net
2003. I only want to update fields that actually have been changed by the
user. So this is the code I have for one field as an example:
In my gotfocus method for each field I have the following 1 liner:
tmpWord = txtSchoolName.Text.ToString()
In my LEAVE method for each field I have the following with the respected
field name:
'trying to determine if the old string matches the new string
Dim intTemp As Int32 = String.Compare(tmpWord, txtcity.Text.ToString())
Select Case intTemp
Case 0
'Strings are the same, do nothing
Case 1
'Strings are different
ModifyDataSet("gcSchoolName")
End Select
The problem is in my ModifyDataSet Sub:
Private Sub ModifyDataSet(ByRef m_strField As String)
Dim intLoop As Integer
For intLoop = 0 To dsSConfig.Tables("sys_cfg").Rows.Count - 1
If String.Compare(dsSConfig.Tables("sys_cfg").Rows(intLoop)
("sysconfg").ToString(), _
m_strField) = 0 Then
dsSConfig.Tables("sys_cfg").Rows(intLoop)("defavalue") =
txtSchoolid.Text <- NEED TO CHANGE AND MAKE DYNAMIC
Exit Sub
How do I make the assigned value to the dataset dynamic for each field
name? All suggestions is greatfully appreciated. Thank you for your help.
to update a dataset then my datasource using the sqlcommandbuilder in vb.net
2003. I only want to update fields that actually have been changed by the
user. So this is the code I have for one field as an example:
In my gotfocus method for each field I have the following 1 liner:
tmpWord = txtSchoolName.Text.ToString()
In my LEAVE method for each field I have the following with the respected
field name:
'trying to determine if the old string matches the new string
Dim intTemp As Int32 = String.Compare(tmpWord, txtcity.Text.ToString())
Select Case intTemp
Case 0
'Strings are the same, do nothing
Case 1
'Strings are different
ModifyDataSet("gcSchoolName")
End Select
The problem is in my ModifyDataSet Sub:
Private Sub ModifyDataSet(ByRef m_strField As String)
Dim intLoop As Integer
For intLoop = 0 To dsSConfig.Tables("sys_cfg").Rows.Count - 1
If String.Compare(dsSConfig.Tables("sys_cfg").Rows(intLoop)
("sysconfg").ToString(), _
m_strField) = 0 Then
dsSConfig.Tables("sys_cfg").Rows(intLoop)("defavalue") =
txtSchoolid.Text <- NEED TO CHANGE AND MAKE DYNAMIC
Exit Sub
How do I make the assigned value to the dataset dynamic for each field
name? All suggestions is greatfully appreciated. Thank you for your help.