2006-11-08

 

Asp.Net2.0 ExecuteScalar

Dim cn As New SqlConnection("Server=localhost;Database=Northwind;UID=sa;PWD=P@ssw0rd;")
Dim cmd As New SqlCommand("select count(orderid) from orders", cn)
cn.Open()
Dim count As Integer = cmd.ExecuteScalar
cn.Close()

Response.Write(count)

Comments: 張貼留言



<< Home

This page is powered by Blogger. Isn't yours?