|登录 |注册

查看: 3867|回复: 18
打印 上一主题 下一主题

vb.net 的 ado.net

[复制链接]
goodday
2008-8-10 12:23 PM

  1. dim StrConn as new sqlconnection("Data Source=PC1;Initial Catalog=test;Integrated Security=True")
  2. dim StrSQL as string("select * from abc")
  3. dim ds as new dataaset
  4. dim ObjApt as new SqlDataAdapter(StrSQL , StrConn )
  5. StrConn.open()
  6. ObjApt.Fill(ds)
  7. StrConn .close()
复制代码


dataset ==>  
==========================================
|    id                   |       name               |   email                      |
==========================================
| 001                  |  ah beng               | ahbeng@abc.com  |
--------------------------------------------------------------------------
| 002                  | ah biao                 | ahbia@abc.com      |
--------------------------------------------------------------------------

把SqlDataAdapter所传进来的 放在 dataset 里

不明请发问
goodday
2008-8-10 12:44 PM
  2003 用着的 东西 我现在用 LINQ   我很懒的~~~ LINQ 可以很懒
goodhermit95
2008-8-10 01:40 PM
我来了
原来是资料库
可以在code后面放 " ' “ 加以解释吗?

回复 #1 goodday 的帖子

goodhermit95
2008-8-13 11:14 PM
刚才发现了
dim StrSQL as string("select * from abc")
正确的
dim StrSql as string = "Select * from abc"

Dim a as new textbox () '这个才是直接挂号
goodhermit95
2008-8-16 02:49 PM
好多错 自己打没用vb的?
  1. Imports System.Data.SqlClient
复制代码
  1. Dim StrConn As New sqlconnection("Data Source=PC1;Initial Catalog=test;Integrated Security=True")
  2. Dim StrSQL As String = "select * from abc"
  3. Dim ds As New DataSet
  4. Dim ObjApt As New SqlDataAdapter(StrSQL, StrConn)
  5.         StrConn.open()
  6.         ObjApt.Fill(ds)
  7.         StrConn.close()
复制代码
goodday
2008-8-17 11:43 PM
呵呵 你知道就好咯

忙麻~~~

回复 #6 goodday 的帖子

goodhermit95
2008-8-18 12:01 PM
出了Const,Dim,set,public 其他都一定会有 = 或者 Array() 是吗?
goodday
2008-8-19 03:07 AM


还有很多的 但用到的很少

回复 #8 goodday 的帖子

goodhermit95
2008-8-19 11:58 AM
我是说不管什么code在一行里面一定会有 = 或者(array) 是吗?
goodday
2008-8-20 07:32 PM
不一定的 
如果是 承继Inherits, 委托Delegate, add handle

如果是 event
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2026-4-27 03:31 PM , Processed in 0.112324 second(s), 24 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部