注册 登录
编程论坛 ASP.NET技术论坛

关于dataset的问题

broon0635 发布于 2007-05-23 15:15, 411 次点击

Dim mycnn As New SqlConnection
Dim myds As New DataSet
Dim sqladp As New SqlDataAdapter

mycnn.ConnectionString = "Data Source=localhost;User ID=sa;Password=sa;Initial Catalog=table;integrated security=false"
mycnn.Open()
sqladp = New SqlDataAdapter("select Value from table, mycnn)
myds = New DataSet()
sqladp.Fill(myds)
我想问一下,上面语句中要知道value的个数有多少,代码怎么写啊。
相当于下面的红色语句。

Dim cnnAs New ADODB.Connection
Dim rsAs New ADODB.Recordset
Dim strSQLAs String
cnn.Open "Provider=SQLOLEDB;Data Source='" & servername & "';User ID=sa;Password=sa;Initial Catalog=table;Persist security Info=True"
Set rs= New ADODB.Recordset
strSQL= "select value FROM ltable
rs.Open strSQL, cnn, adOpenStatic, adLockReadOnly
row = rs_new.RecordCount


5 回复
#2
从小到大2007-05-23 15:56
myds.table[0].rows.count
C#是这样的
#3
broon06352007-05-23 16:50

有没有知道vb.net语言的??

#4
tel19822007-05-23 19:57
用COUNT()函数不行吗??
#5
broon06352007-05-24 09:01
怎么写啊??
#6
bygg2007-05-24 09:56
rs_new 是什么?>
1