⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 get-dataview-control.ascx

📁 This is a book about vb.you could learn this from this book
💻 ASCX
字号:
<%@Control Language="VB"%>

<%@Import Namespace="System.Data" %>
<%@Import Namespace="System.Data.OleDb" %>

<script language="vb" runat="server">

Function GetDataView(ByVal strConnect As String, ByVal strSQL As String) As DataView

   'creates a DataView object based on a single table holding data specified
   'in the connection string and SQL statement provided as parameters

   Try

      'create a new Connection object using the connection string
      Dim objConnect As New OleDbConnection(strConnect)

      'create a new DataAdapter using the connection object and select statement
      Dim objDataAdapter As New OleDbDataAdapter(strSQL, objConnect)

      'create a new DataSet object to fill with data
      Dim objDataSet As New DataSet()

      'fill the dataset with data from the DataAdapter object
      objDataAdapter.Fill(objDataSet, "Books")

      Return objDataSet.Tables(0).DefaultView

   Catch objError As Exception

      Return Nothing

   End Try

End Function
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -