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

📄 productsdataset.designer.vb

📁 Microsoft Mobile Development Handbook的代码,有C#,VB,C++的
💻 VB
📖 第 1 页 / 共 5 页
字号:
        Public Overloads Overridable Function Update(ByVal dataSet As ProductsDataSet) As Integer
            Return Me.Adapter.Update(dataSet, "Product")
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Overloads Overridable Function Update(ByVal dataRow As System.Data.DataRow) As Integer
            Return Me.Adapter.Update(New System.Data.DataRow() {dataRow})
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Overloads Overridable Function Update(ByVal dataRows() As System.Data.DataRow) As Integer
            Return Me.Adapter.Update(dataRows)
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)>  _
        Public Overloads Overridable Function Delete(ByVal p1 As Integer) As Integer
            Me.Adapter.DeleteCommand.Parameters(0).Value = CType(p1,Integer)
            Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State
            If ((Me.Adapter.DeleteCommand.Connection.State And System.Data.ConnectionState.Open)  _
                        <> System.Data.ConnectionState.Open) Then
                Me.Adapter.DeleteCommand.Connection.Open
            End If
            Try 
                Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery
                Return returnValue
            Finally
                If (previousConnectionState = System.Data.ConnectionState.Closed) Then
                    Me.Adapter.DeleteCommand.Connection.Close
                End If
            End Try
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)>  _
        Public Overloads Overridable Function Insert(ByVal p1 As String, ByVal p2 As String, ByVal p3 As Decimal, ByVal p4 As String, ByVal p5 As Integer) As Integer
            If (p1 Is Nothing) Then
                Throw New System.ArgumentNullException("p1")
            Else
                Me.Adapter.InsertCommand.Parameters(0).Value = CType(p1,String)
            End If
            If (p2 Is Nothing) Then
                Me.Adapter.InsertCommand.Parameters(1).Value = System.DBNull.Value
            Else
                Me.Adapter.InsertCommand.Parameters(1).Value = CType(p2,String)
            End If
            Me.Adapter.InsertCommand.Parameters(2).Value = CType(p3,Decimal)
            If (p4 Is Nothing) Then
                Me.Adapter.InsertCommand.Parameters(3).Value = System.DBNull.Value
            Else
                Me.Adapter.InsertCommand.Parameters(3).Value = CType(p4,String)
            End If
            Me.Adapter.InsertCommand.Parameters(4).Value = CType(p5,Integer)
            Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State
            If ((Me.Adapter.InsertCommand.Connection.State And System.Data.ConnectionState.Open)  _
                        <> System.Data.ConnectionState.Open) Then
                Me.Adapter.InsertCommand.Connection.Open
            End If
            Try 
                Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery
                Return returnValue
            Finally
                If (previousConnectionState = System.Data.ConnectionState.Closed) Then
                    Me.Adapter.InsertCommand.Connection.Close
                End If
            End Try
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)>  _
        Public Overloads Overridable Function Update(ByVal p1 As String, ByVal p2 As String, ByVal p3 As Decimal, ByVal p4 As String, ByVal p5 As Integer, ByVal p6 As Integer) As Integer
            If (p1 Is Nothing) Then
                Throw New System.ArgumentNullException("p1")
            Else
                Me.Adapter.UpdateCommand.Parameters(0).Value = CType(p1,String)
            End If
            If (p2 Is Nothing) Then
                Me.Adapter.UpdateCommand.Parameters(1).Value = System.DBNull.Value
            Else
                Me.Adapter.UpdateCommand.Parameters(1).Value = CType(p2,String)
            End If
            Me.Adapter.UpdateCommand.Parameters(2).Value = CType(p3,Decimal)
            If (p4 Is Nothing) Then
                Me.Adapter.UpdateCommand.Parameters(3).Value = System.DBNull.Value
            Else
                Me.Adapter.UpdateCommand.Parameters(3).Value = CType(p4,String)
            End If
            Me.Adapter.UpdateCommand.Parameters(4).Value = CType(p5,Integer)
            Me.Adapter.UpdateCommand.Parameters(5).Value = CType(p6,Integer)
            Dim previousConnectionState As System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State
            If ((Me.Adapter.UpdateCommand.Connection.State And System.Data.ConnectionState.Open)  _
                        <> System.Data.ConnectionState.Open) Then
                Me.Adapter.UpdateCommand.Connection.Open
            End If
            Try 
                Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery
                Return returnValue
            Finally
                If (previousConnectionState = System.Data.ConnectionState.Closed) Then
                    Me.Adapter.UpdateCommand.Connection.Close
                End If
            End Try
        End Function
    End Class
    
    <System.ComponentModel.DesignerCategoryAttribute("code"),  _
     System.ComponentModel.DataObjectAttribute(true)>  _
    Partial Public Class ProductCategoryTableAdapter
        Inherits System.ComponentModel.Component
        
        Private WithEvents _adapter As System.Data.SqlServerCe.SqlCeDataAdapter
        
        Private _connection As System.Data.SqlServerCe.SqlCeConnection
        
        Private _commandCollection() As System.Data.SqlServerCe.SqlCeCommand
        
        Private _clearBeforeFill As Boolean
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Sub New()
            MyBase.New
            Me.ClearBeforeFill = true
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private ReadOnly Property Adapter() As System.Data.SqlServerCe.SqlCeDataAdapter
            Get
                If (Me._adapter Is Nothing) Then
                    Me.InitAdapter
                End If
                Return Me._adapter
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Friend Property Connection() As System.Data.SqlServerCe.SqlCeConnection
            Get
                If (Me._connection Is Nothing) Then
                    Me.InitConnection
                End If
                Return Me._connection
            End Get
            Set
                Me._connection = value
                If (Not (Me.Adapter.InsertCommand) Is Nothing) Then
                    Me.Adapter.InsertCommand.Connection = value
                End If
                If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then
                    Me.Adapter.DeleteCommand.Connection = value
                End If
                If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then
                    Me.Adapter.UpdateCommand.Connection = value
                End If
                Dim i As Integer = 0
                Do While (i < Me.CommandCollection.Length)
                    If (Not (Me.CommandCollection(i)) Is Nothing) Then
                        CType(Me.CommandCollection(i),System.Data.SqlServerCe.SqlCeCommand).Connection = value
                    End If
                    i = (i + 1)
                Loop
            End Set
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Protected ReadOnly Property CommandCollection() As System.Data.SqlServerCe.SqlCeCommand()
            Get
                If (Me._commandCollection Is Nothing) Then
                    Me.InitCommandCollection
                End If
                Return Me._commandCollection
            End Get
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Public Property ClearBeforeFill() As Boolean
            Get
                Return Me._clearBeforeFill
            End Get
            Set
                Me._clearBeforeFill = value
            End Set
        End Property
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitAdapter()
            Me._adapter = New System.Data.SqlServerCe.SqlCeDataAdapter
            Dim tableMapping As System.Data.Common.DataTableMapping = New System.Data.Common.DataTableMapping
            tableMapping.SourceTable = "Table"
            tableMapping.DataSetTable = "ProductCategory"
            tableMapping.ColumnMappings.Add("ProductCategoryID", "ProductCategoryID")
            tableMapping.ColumnMappings.Add("Name", "Name")
            Me._adapter.TableMappings.Add(tableMapping)
            Me._adapter.DeleteCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.DeleteCommand.Connection = Me.Connection
            Me._adapter.DeleteCommand.CommandText = "DELETE FROM [ProductCategory] WHERE (([ProductCategoryID] = @p1) AND ([Name] = @p"& _ 
                "2))"
            Me._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text
            Dim param As System.Data.SqlServerCe.SqlCeParameter = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductCategoryID"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.DeleteCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p2"
            param.IsNullable = true
            param.SourceColumn = "Name"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.DeleteCommand.Parameters.Add(param)
            Me._adapter.InsertCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.InsertCommand.Connection = Me.Connection
            Me._adapter.InsertCommand.CommandText = "INSERT INTO [ProductCategory] ([Name]) VALUES (@p1)"
            Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.IsNullable = true
            param.SourceColumn = "Name"
            Me._adapter.InsertCommand.Parameters.Add(param)
            Me._adapter.UpdateCommand = New System.Data.SqlServerCe.SqlCeCommand
            Me._adapter.UpdateCommand.Connection = Me.Connection
            Me._adapter.UpdateCommand.CommandText = "UPDATE [ProductCategory] SET [Name] = @p1 WHERE (([ProductCategoryID] = @p2) AND "& _ 
                "([Name] = @p3))"
            Me._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p1"
            param.IsNullable = true
            param.SourceColumn = "Name"
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p2"
            param.DbType = System.Data.DbType.Int32
            param.IsNullable = true
            param.SourceColumn = "ProductCategoryID"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.UpdateCommand.Parameters.Add(param)
            param = New System.Data.SqlServerCe.SqlCeParameter
            param.ParameterName = "@p3"
            param.IsNullable = true
            param.SourceColumn = "Name"
            param.SourceVersion = System.Data.DataRowVersion.Original
            Me._adapter.UpdateCommand.Parameters.Add(param)
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitConnection()
            Me._connection = New System.Data.SqlServerCe.SqlCeConnection
            Me._connection.ConnectionString = ("Data Source ="  _
                        + (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase)  _
                        + ("\MyDatabase.sdf;"  _
                        + ("Password =" + """MobileP@ssw0rd"";"))))
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute()>  _
        Private Sub InitCommandCollection()
            Me._commandCollection = New System.Data.SqlServerCe.SqlCeCommand(0) {}
            Me._commandCollection(0) = New System.Data.SqlServerCe.SqlCeCommand
            Me._commandCollection(0).Connection = Me.Connection
            Me._commandCollection(0).CommandText = "SELECT [ProductCategoryID], [Name] FROM [ProductCategory]"
            Me._commandCollection(0).CommandType = System.Data.CommandType.Text
        End Sub
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)>  _
        Public Overloads Overridable Function Fill(ByVal dataTable As ProductsDataSet.ProductCategoryDataTable) As Integer
            Me.Adapter.SelectCommand = Me.CommandCollection(0)
            If (Me.ClearBeforeFill = true) Then
                dataTable.Clear
            End If
            Dim returnValue As Integer = Me.Adapter.Fill(dataTable)
            Return returnValue
        End Function
        
        <System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
         System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.[Select], true)>  _
        Public Ove

⌨️ 快捷键说明

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