Presentation is loading. Please wait.

Presentation is loading. Please wait.

.NET + SQL SERVER SQL Server +SP4.

Similar presentations


Presentation on theme: ".NET + SQL SERVER SQL Server +SP4."— Presentation transcript:

1 .NET + SQL SERVER SQL Server +SP4

2

3

4

5

6

7

8

9

10 Dim cn As System.Data.SqlClient.SqlConnection
Dim cmd As System.Data.SqlClient.SqlCommand Dim da As System.Data.SqlClient.SqlDataAdapter ' 建立與SQL Server資料庫的連線 cn = New System.Data.SqlClient.SqlConnection("uid=nwd;pwd=nwd;database=Northwind;server= ") cmd = New System.Data.SqlClient.SqlCommand("select * from employees", cn) da = New System.Data.SqlClient.SqlDataAdapter(cmd) ‘ 加入新的資料表 Dim dt As System.Data.DataTable = New System.Data.DataTable("employees") da.Fill(dt) DataGrid1.DataSource = dt

11 .NET + SQL CE

12 Dim cmd As System.Data.SqlServerCE.SqlCeCommand
Dim cn As System.Data.SqlServerCe.SqlCeConnection Dim da As System.Data.SqlServerCe.SqlCeDataAdapter cn = New System.Data.SqlServerce.SqlCeConnection("Data Source=" & ApplicationLocation() & "\NorthwindDemo.sdf") cmd = New System.Data.SqlServerCE.SqlCeCommand("select * from Customers", cn) da = New System.Data.SqlServerCE.SqlCeDataAdapter(cmd) Dim dt As System.Data.DataTable = New System.Data.DataTable("Customers") da.Fill(dt) DataGrid1.DataSource = dt

13 Private Function ApplicationLocation() As String
ApplicationLocation = _ System.IO.Path.GetDirectoryName(Reflection.Assembly. _ GetExecutingAssembly().GetName().CodeBase.ToString()) End Function

14

15


Download ppt ".NET + SQL SERVER SQL Server +SP4."

Similar presentations


Ads by Google