VB读取sql文并删除
时间:2021-07-01 10:21:17
帮助过:21人阅读
Sub UpdateTask()
Dim connStr
As String = ConfigurationManager.connectionStrings(
"TaxSoftwareConnection").ToString()
if File.Exists(path)
Dim file
As FileInfo=
New FileInfo(path)
Dim sr
As StreamReader =
file.OpenText()
Dim script
As String=
sr.ReadToEnd()
Try
Dim conn
As SqlConnection=
new SqlConnection(connStr)
conn.Open()
Dim cmd
As SqlCommand=
conn.CreateCommand()
cmd.CommandText=
script
cmd.ExecuteNonQuery()
conn.Close()
Catch ex
As Exception
End Try
sr.Close()
file.Delete()
End If
End Sub
VB读取sql文并删除
标签:str rip exist task cmd man creat ons 删除