本文介绍了我如何将rss地址的所有数据复制到sql数据库中? (asp.net vb)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
如何将rss地址的所有数据复制到sql数据库中? (vb.net)...
hi all
how i can copy all data of an rss address into sql database? (vb.net)...
推荐答案
Dim dst As New DataSet
dst = RssDataSource2.Rss.ToDataSet()
Dim connect As SqlConnection
Dim command As SqlCommand
Dim query As String
'Dim s(,,) As String
connect = New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\admin\Documents\RssFeed.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
query = "insert into RSS1 values(@title)"
command = New SqlCommand(query, connect)
command.Parameters.AddWithValue("@title", dst.GetXml.ToString)
connect.Open()
If command.ExecuteNonQuery() Then
Response.Write("Ok")
Else
Response.Write("No")
End If
connect.Close()
这篇关于我如何将rss地址的所有数据复制到sql数据库中? (asp.net vb)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!