Progress Monitor for IdealProgrammer.com
Take Swift, Intelligent, Massive, Planned, Loving, Effective (S.I.M.P.L.E.) Action to Transform Self into Ideal
Skip Repetitive Navigational Links
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console
Please login
VB.NET
Description:
Illustrates using SqlConnection Connection String.
Example Class:
Imports System.Data Imports System.Data.SqlClient Public Class clsSQLConnectionConnectionString Shared WithEvents con As SqlConnection Sub Main() con = New SqlConnection("Server=.\SQLEXPRESS;Initial Catalog=master;Integrated Security=SSPI") Dim cmd As New SqlCommand() cmd.CommandText = "PRINT('This is how to create an InfoMessage event')" cmd.Connection = con Try con.Open() cmd.ExecuteNonQuery() Finally con.Close() End Try Console.ReadLine() End Sub Shared Sub con_InfoMessage(ByVal Sender As Object, _ ByVal E As SqlInfoMessageEventArgs) Handles con.InfoMessage Console.WriteLine( _ "{0} - {1}", "InfoMessage", E.Errors.Item(0).ToString()) End Sub End Class
Example Module:
Module Module1 Sub Main() '***** DataBase-ADO-NET ************* Dim mySQLConnectionConnectionString As New clsSQLConnectionConnectionString mySQLConnectionConnectionString.Main() End Sub End Module
Home
News
Presenters
Register
Contact
Categories
Titles
Converter
Code Samples
C# ASP.NET
C# Console
HTML
JavaScript
SQL Server
VB ASP.NET
VB Console