以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  在datacolchanged中,将其他表增加了行,但数据无法复制过去,怎么回事?  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=30208)

--  作者:东坡一剑
--  发布时间:2013/3/23 2:36:00
--  在datacolchanged中,将其他表增加了行,但数据无法复制过去,怎么回事?

    大侠快帮忙!

 

Case "货号"
        \'根据货号从"名称货号单价"中提取数据,如果没有,则录入数据,并保存在"名称货号单价"中 ?????
        Dim sts As String() = {"货号","产品名称","吊牌价","品类","细类","季别","男式女式"}
        Dim dr As DataRow =DataTables("名称货号单价").Find("[货号] = \'" & e.NewValue & "\'")
        If dr IsNot Nothing Then
            For Each st As String In sts
                e.DataRow(st) = dr(st)
            Next
        Else
            Dim result As dialogresult =  MessageBox.show("此货号数据库无记录,是否添加?","提示",MessageBoxbuttons.yesno)
                If result = DialogResult.Yes Then
            DataTables("名称货号单价").AddNew()   ‘这个实现了!!!!!
            Select Case e.DataCol.Name
               
                Case "货号","产品名称","吊牌价"
                 Dim sts2 As  String() ={"货号","产品名称","吊牌价"}
                For Each st2 As String In sts
                    If e.DataRow.IsNull("货号") =False And e.DataRow.IsNull("产品名称") =False And e.DataRow.IsNull("吊牌价") =False Then
      
                        DataTables("名称货号单价").DataRows(DataTables("名称货号单价").DataRows.count - 1)(st2) = e.DataRow(st2) ’这个实现不了??
                        
                    End If
                Next
              End Select             
        End If
End If

[此贴子已经被作者于2013-3-23 2:36:21编辑过]

--  作者:唐尸三摆手
--  发布时间:2013/3/23 9:00:00
--  

\'没看出来,代码还挺绕,楼上是不是想把基础信息库没有的加进去?

 

dim nr as datarow = DataTables("名称货号单价").AddNew()  

nr("货号") = e.datarow("货号")

nr("产品名称") = ?

nr("吊牌价") = ?

 

这样是不是可以了?