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 に答える