如题!

解决方案 »

  1.   

    比如table a,table b
    insert into a.A,a.B values (b.A,b.B) from table1 a,table2 b
      

  2.   

    Public Function ObjDt(ByVal Dataset As DataSet, ByVal FrmName As String) As DataTable
            Dim ClientClass As New ClientClass
            Dim Ds As New DataSet
            Dim Dt As New DataTable        Ds.Tables.Add("table")
            Dt = Ds.Tables("table")
            Dim i As Integer = 0
            Dim j As Integer = 0
            Dim ColsCount As Integer = Dataset.Tables(0).Columns.Count
            Dim RowsCount As Integer = Dataset.Tables(0).Rows.Count        Dim Dr(RowsCount) As DataRow
            With Dt            
                Do While i < ColsCount '增加列   你可在改一下这个地方,只加入你想要的几列
                    .Columns.Add(ClientClass.ColumnHeadTextChinese(Dataset.Tables(0).Columns(i).ColumnName, FrmName).TextChinese, Dataset.Tables(0).Columns(i).DataType)
                    i = i + 1
                Loop
                i = 0
                Do While i < RowsCount '增加记录                       
                    Dr(i) = .NewRow
                    j = 0
                    Do While j < ColsCount  '此处可改成需要的列
                        Dr(i).Item(j) = Dataset.Tables(0).Rows(i).Item(j)
                        j = j + 1
                    Loop
                    .Rows.Add(Dr(i))
                    i = i + 1
                Loop
            End With        Return Dt
        End Function
      

  3.   

    将DataTable One   中的某几列数据倒入DataTable Two 中
    必须要将Two表进行定义,否则他找不到表;另在Two中至少存在和One表中要到出的列的字段一样的列,否则会报错。然后在进行倒出倒入!
      

  4.   

    DataTable dt = dt1;
    dt.Select(string filterExprossion,string sort);