国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

解決一個.NET聯(lián)接SQL的問題 yiyang(轉(zhuǎn)貼)

2024-07-10 13:02:46
字體:
供稿:網(wǎng)友
  • 網(wǎng)站運營seo文章大全
  • 提供全面的站長運營經(jīng)驗及seo技術(shù)!
  • 解決一個.net聯(lián)接sql的問題    yiyang(轉(zhuǎn)貼)  
      
    關(guān)鍵字     .net
      
    出處     http://ouynagouyang
      


    imports system.data
    imports system.data.sqlclient
    imports system.data.sqlclient.sqlexception
    public class connect
        private s as string
        private s1 as string
        public connect as new sqlconnection("server=yiyang;database=kderp;uid=sa;password=123")
        sub new()
            connect.open()
        end sub
        public property sql()
            get
                return s
            end get
            set(byval value)
                s = value
            end set
        end property
        'public property table()
        '    get
        '        return s1
        '    end get
        '    set(byval value)
        '        s1 = value

        'end property
        public function retable() as datatable

            dim com as new dataset()

            dim ada as new sqldataadapter()
            dim com1 as new sqlcommand()
            com1.connection = connect
            com1.commandtext = s
            ada.selectcommand = com1
            ada.fill(com, "t1")
            return com.tables(0)

        end function
        public function exec() as integer
            dim i as integer

            dim com as new sqlcommand()
            com.commandtext = s
            com.connection = connect
            i = com.executenonquery()
            return i
        end function
        public function retdataset(byval t as string) as dataset

            dim com as new sqlcommand()
            com.connection = connect
            com.commandtext = s
            dim ada as new sqldataadapter()
            ada.selectcommand = com
            dim da as new dataset()
            ada.fill(da, t)
            return da
        end function
        public function retdataread() as sqldatareader

            dim com as new sqlcommand()
            com.connection = connect
            com.commandtext = s
            return com.executereader
        end function
    end class



    發(fā)表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發(fā)表
    主站蜘蛛池模板: 江永县| 竹北市| 安图县| 北辰区| 威远县| 高平市| 永昌县| 东乌珠穆沁旗| 深水埗区| 酒泉市| 宣城市| 弥渡县| 汉川市| 河源市| 永丰县| 同心县| 萨嘎县| 九龙坡区| 五指山市| 若尔盖县| 多伦县| 平武县| 本溪市| 石嘴山市| 从江县| 桐梓县| 金寨县| 大方县| 奇台县| 涟水县| 思茅市| 潼南县| 九龙坡区| 恩施市| 比如县| 莲花县| 江山市| 绥江县| 宜兰市| 财经| 资溪县|