收藏本站 | 设计教程 | 设计素材 | 教程 | ppt素材 | 试题课件 | 文书写作 | 常识 | 学习方法 | 作文辅导 | 自考 | 计算机 | 公务员 | 名言好词
订阅
首页
学习方法 教案大全 说课稿 课件中心 试卷中心 作文大全 高考 中考 诗词 幼教 考研 中职 教师 英语
热门: 教学计划总结 快速阅读 学习计划 右脑开发 广告设计 设计素材 公文 评语 书信 写作素材 自考 计算机考试 中职试题 中职课件 电脑 语录名言 幼儿园教案
当前位置:一路求学网学习网电脑学习电脑系统故障解决一个.NET联接SQL的问题

解决一个.NET联接SQL的问题

一路求学网 http://www.16qiuxue.com  阅览次数: 127次 12-28 20:10:57 

标签:电脑故障大全,电脑故障维修,电脑故障分析,http://www.16qiuxue.com 解决一个.NET联接SQL的问题,

  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
  
  
  
   解决一个.NET联接SQL的问题,解决一个.NET联接SQL的问题
《解决一个.NET联接SQL的问题》相关文章
  • 解决一个.NET联接SQL的问题
  • tag: 暂无联系方式 电脑系统故障,电脑故障大全,电脑故障维修,电脑故障分析,电脑学习 - 电脑系统故障

网友评论>>

联系我们 | 网站地图 | 广告设计 | 设计素材 | 教程大全 | ppt素材 | 中职教育 | 范文大全 | 常识大全 | 学习方法 | 作文大全
一路求学网 版权所有. Copyright © - http://www.16qiuxue.com. All rights reserved.
学习方法
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18