ASP.NET连SQL7接口源代码
The following example shows what a simple ADO.NET application that connects to the Northwind database and returns a list of Categories would look like. The example writes the output to the console, or command prompt.
The following example shows what a simple ADO.NET application that connects to the Northwind database and returns a list of Categories. The example writes the output to the console, or command prompt.
SqlClient
[Visual Basic]
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Sample
Public Shared Sub Main()
Dim nwindConn As SqlConnection = New SqlConnection("Data Source=localhost;" & _
"User Id=sa;Password=pwd;Initial Catalog=northwind")
The following example shows what a simple ADO.NET application that connects to the Northwind database and returns a list of Categories would look like. The example writes the output to the console, or command prompt.
The following example shows what a simple ADO.NET application that connects to the Northwind database and returns a list of Categories. The example writes the output to the console, or command prompt.
SqlClient
[Visual Basic]
Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports Microsoft.VisualBasic
Public Class Sample
Public Shared Sub Main()
Dim nwindConn As SqlConnection = New SqlConnection("Data Source=localhost;" & _
"User Id=sa;Password=pwd;Initial Catalog=northwind")