|
|
|
Click here to copy the following block |
Sub ExecuteSqlScripts(ByVal connString As String, ByVal ParamArray scriptFiles() _ As String) Dim cn As New SqlConnection(connString) Dim cmd As New SqlCommand Try cn.Open() cmd.Connection = cn
Dim scriptFile As String For Each scriptFile In scriptFiles Dim sr As System.IO.StreamReader = Nothing Try sr = New System.IO.StreamReader(scriptFile) cmd.CommandText = sr.ReadToEnd() Catch ex As Exception Throw ex Finally If Not sr Is Nothing Then sr.Close() End Try cmd.ExecuteNonQuery() Next Catch ex As Exception Throw ex Finally cn.Close() End Try End Sub |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|