解决一个.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的问题
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: 暂无联系方式 电脑系统故障,电脑故障大全,电脑故障维修,电脑故障分析,电脑学习 - 电脑系统故障
网友评论>>
栏目分类
电脑系统故障 推荐
- · 奇怪光驱故障,换盘不换内容
- · 取下硬盘竟蓝屏,原是虚拟光驱惹祸
- · 光驱为何不读盘?
- · 刻录原理之光盘种类识别
- · 光驱与光盘的故障案例全分析
- · 光驱挑盘的故障原因分析与解决
- · 光驱使用保养大全1
- · 你学会怎样正确地使用CD刻录机了吗?
- · 想让你的光驱跑得更欢?刷新固件吧!
- · 刻录机故障维修
- · 光盘打滑故障分析与排除
- · 光驱“假”死故障分析与排除
- · 巧除光驱故障两例
- · 常见Windows故障全面排除方案
- · 电脑非正常关机再开机后不能自动进行磁盘扫
- · 如何在WinPE系统下安装Windows7
- · 系统变慢要留心啊!
- · Linux系统常见6种急救措施
- · Linux常见故障的紧急处理方法
- · 光驱复活记,修复光驱读盘打滑的问题
- · 快速清除刻录盘上病毒的方法
- · 光盘超容量刻录的原理和操作方法
- · 展逐招教你排除光驱七宗稀奇故障
- · 光驱丢失的原因分析及解决办法
- · 刻录时间偏长是怎么回事?
- · 了解常见刻录光盘主要类型差异