我想将数据集内置于其他数据表
中的同一数据库中这是我的代码
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
如何将此数据放入其他数据库?
有什么想法吗?
答案 0 :(得分: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")