Untitled
By: a guest | Apr 21st, 2010 | Syntax:
VB.NET | Size: 1.15 KB | Hits: 148 | Expires: Never
Imports System.Data.SqlClient
Module Module1
Sub Main(ByVal sArgs() As String)
Dim ConnString As String
'Connstring = Server Name, Database Name, Windows Authentication
ConnString = "Data Source=MATHEW-PC\SQLEXPRESS;Initial Catalog=Test;Integrated Security=True"
'Write to SQL
Dim SQLConn As New SqlConnection() 'The SQL Connection
Dim SQLCmd As New SqlCommand() 'The SQL Command
SQLConn.ConnectionString = ConnString 'Set the Connection String
SQLConn.Open() 'Open the connection
Try
SQLCmd = New SqlCommand("sps_rssfeeds_delete", SQLConn)
SQLCmd.CommandType = CommandType.StoredProcedure
Dim sampParm As SqlParameter = SQLCmd.Parameters.Add("@p_rssid", SqlDbType.Int)
sampParm.Value = 3
SQLCmd.ExecuteNonQuery()
Catch ex As Exception
Console.WriteLine(ex.Message)
Throw
Finally
SQLConn.Close()
End Try
SQLConn.Close() 'Close the connection
SQLConn.Dispose()
Console.ReadLine()
End Sub
End Module