0

我想将数据集中的数据集放到另一个数据表中的同一个数据库中

这是我的代码

Dim Conn As SqlConnection = New SqlConnection("server=localhost;database=MSDSS;Integrated Security=True")
    Dim urltext = "Select JournalName, IndexDB, Lang, Category From SJournal where JournalName is not null" + " And IndexDB='" & indexdb & "' And Lang='" & lang & "' And [Impact Factor] Between " & ImpactFactorBegin & " And " & ImpactFactorEnd
    Dim Ad As SqlDataAdapter = New SqlDataAdapter(urltext, Conn)
    Dim D As DataSet = New DataSet()

    Ad.Fill(D, "SJ")
    D.Tables(0).Columns.Add(New DataColumn("STV"))
    Dim journallist() As String = journalname.Split("()")
    For i As Integer = 0 To D.Tables(0).Rows.Count - 1 Step 1
        D.Tables(0).Rows(i)("STV") = GetSimilarityWith(D.Tables(0).Rows(i).Item(0).ToString, journalname)

    Next i

我怎样才能把这些数据放到其他数据库?

有什么想法吗?

4

1 回答 1

0
Dim Conn As SqlConnection = New SqlConnection("server=localhost;database=MSDSS;Integrated Security=True")
Dim Conn2 As SqlConnection = New SqlConnection("server=OTHER DB;database=MSDSS;Integrated Security=True")
Dim urltext = "Select JournalName, IndexDB, Lang, Category From SJournal where JournalName is not null" + " And IndexDB='" & indexdb & "' And Lang='" & lang & "' And [Impact Factor] Between " & ImpactFactorBegin & " And " & ImpactFactorEnd
Dim Ad As SqlDataAdapter = New SqlDataAdapter(urltext, Conn)
Dim Ad2 As SqlDataAdapter = New SqlDataAdapter(urltext, Conn2)
Dim D As DataSet = New DataSet()

Ad.Fill(D, "SJ")
D.Tables(0).Columns.Add(New DataColumn("STV"))
Dim journallist() As String = journalname.Split("()")
For i As Integer = 0 To D.Tables(0).Rows.Count - 1 Step 1
    D.Tables(0).Rows(i)("STV") = GetSimilarityWith(D.Tables(0).Rows(i).Item(0).ToString, journalname)
Next i

Ad2.Fill(D, "SJ")
于 2013-02-07T15:27:47.930 回答