📄 joinqueryresultset.designer.vb
字号:
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.312
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict Off
Option Explicit On
Imports System
Imports System.Data
Partial Public Class ProductsCategoryResultSet
Inherits System.Data.SqlServerCe.SqlCeResultSet
Private resultSetConnectionString As String = Nothing
Private sqlCeConnection As System.Data.SqlServerCe.SqlCeConnection = Nothing
Private resultSetOptions As System.Data.SqlServerCe.ResultSetOptions
Public Sub New()
MyBase.New
'Create default options
'
resultSetOptions = System.Data.SqlServerCe.ResultSetOptions.Scrollable
resultSetOptions = (resultSetOptions Or System.Data.SqlServerCe.ResultSetOptions.Sensitive)
resultSetOptions = (resultSetOptions Or System.Data.SqlServerCe.ResultSetOptions.Updatable)
'To enable design time support, the resultSetConnectionString property needs to switched between a Designtime and Runtime connection string.
'The design time connection string is used to make a valid connection to the database and retrieve schema information.
'
If JOINQueryResultSetUtil.DesignerUtil.IsDesignTime Then
'Designtime Connection String
resultSetConnectionString = "Data Source =""C:\Users\Andy\Documents\Compact Framework Book V2.0\Sample Code\Cha"& _
"pter 3\VB\SqlCeDataSetsAndSqlCqResultSets\SqlCeDataSetsAndSqlCqResultSets\MyData"& _
"base.sdf""; Password =""MobileP@ssw0rd"";"
Else
'Runtime Connection String
resultSetConnectionString = ("Data Source =" _
+ (System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.GetName.CodeBase) _
+ ("\MyDatabase.sdf;" _
+ ("Password =" + """MobileP@ssw0rd"";"))))
End If
'Call Open() to initialize the ResultSet
'
Me.Open
End Sub
Public Sub New(ByVal connectionString As String, ByVal options As System.Data.SqlServerCe.ResultSetOptions)
MyBase.New
resultSetConnectionString = connectionString
resultSetOptions = options
Me.Open
End Sub
Public ReadOnly Property Connection() As System.Data.SqlServerCe.SqlCeConnection
Get
Return sqlCeConnection
End Get
End Property
Public Property ProductID() As Integer
Get
Try
Return CType(MyBase.GetInt32(MyBase.GetOrdinal("ProductID")),Integer)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("StrongTyping_CananotAccessDBNull", e)
End Try
End Get
Set
MyBase.SetInt32(MyBase.GetOrdinal("ProductID"), value)
End Set
End Property
Public Property Name() As String
Get
Try
Return CType(MyBase.GetString(MyBase.GetOrdinal("Name")),String)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("StrongTyping_CananotAccessDBNull", e)
End Try
End Get
Set
MyBase.SetString(MyBase.GetOrdinal("Name"), value)
End Set
End Property
Public Property Size() As String
Get
Try
Return CType(MyBase.GetString(MyBase.GetOrdinal("Size")),String)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("StrongTyping_CananotAccessDBNull", e)
End Try
End Get
Set
MyBase.SetString(MyBase.GetOrdinal("Size"), value)
End Set
End Property
Public Property CategoryName() As String
Get
Try
Return CType(MyBase.GetString(MyBase.GetOrdinal("CategoryName")),String)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("StrongTyping_CananotAccessDBNull", e)
End Try
End Get
Set
MyBase.SetString(MyBase.GetOrdinal("CategoryName"), value)
End Set
End Property
Public Sub Open()
Dim sqlCeSelectCommand As System.Data.SqlServerCe.SqlCeCommand
'Open a connection to the database
'
sqlCeConnection = New System.Data.SqlServerCe.SqlCeConnection(Me.resultSetConnectionString)
sqlCeConnection.Open
'Create the command
'
sqlCeSelectCommand = sqlCeConnection.CreateCommand
sqlCeSelectCommand.CommandText = "ProductsCategory"
sqlCeSelectCommand.CommandType = System.Data.CommandType.TableDirect
'Generate the ResultSet
'
sqlCeSelectCommand.ExecuteResultSet(Me.resultSetOptions, Me)
End Sub
Public Sub MoveToRow(ByVal Row As Integer)
MyBase.ReadAbsolute(Row)
End Sub
Public Sub DeleteRecord()
MyBase.Delete
End Sub
Public Function IsProductIDNull() As Boolean
Return MyBase.IsDBNull(MyBase.GetOrdinal("ProductID"))
End Function
Public Sub SetProductIDNull()
MyBase.SetValue(MyBase.GetOrdinal("ProductID"), System.DBNull.Value)
End Sub
Public Function IsNameNull() As Boolean
Return MyBase.IsDBNull(MyBase.GetOrdinal("Name"))
End Function
Public Sub SetNameNull()
MyBase.SetValue(MyBase.GetOrdinal("Name"), System.DBNull.Value)
End Sub
Public Function IsSizeNull() As Boolean
Return MyBase.IsDBNull(MyBase.GetOrdinal("Size"))
End Function
Public Sub SetSizeNull()
MyBase.SetValue(MyBase.GetOrdinal("Size"), System.DBNull.Value)
End Sub
Public Function IsCategoryNameNull() As Boolean
Return MyBase.IsDBNull(MyBase.GetOrdinal("CategoryName"))
End Function
Public Sub SetCategoryNameNull()
MyBase.SetValue(MyBase.GetOrdinal("CategoryName"), System.DBNull.Value)
End Sub
Public Sub AddProductsCategoryRecord(ByVal ProductID As Integer, ByVal Name As String, ByVal Size As String, ByVal CategoryName As String)
Dim newRecord As System.Data.SqlServerCe.SqlCeUpdatableRecord = MyBase.CreateRecord
newRecord("ProductID") = ProductID
newRecord("Name") = Name
newRecord("Size") = Size
newRecord("CategoryName") = CategoryName
MyBase.Insert(newRecord)
End Sub
Public Sub Bind(ByVal bindingSource As System.Windows.Forms.BindingSource)
bindingSource.DataSource = Me.ResultSetView
End Sub
End Class
Namespace JOINQueryResultSetUtil
Partial Public Class DesignerUtil
Public Shared Function IsDesignTime() As Boolean
'Determine if this instance is running against .NET Framework by using the MSCoreLib PublicKeyToken
Dim mscorlibAssembly As System.Reflection.[Assembly] = GetType(Integer).Assembly
If (Not (mscorlibAssembly) Is Nothing) Then
If mscorlibAssembly.FullName.ToUpper.EndsWith("B77A5C561934E089") Then
Return true
End If
End If
Return false
End Function
Public Shared Function IsRunTime() As Boolean
'Determine if this instance is running against .NET Compact Framework by using the MSCoreLib PublicKeyToken
Dim mscorlibAssembly As System.Reflection.[Assembly] = GetType(Integer).Assembly
If (Not (mscorlibAssembly) Is Nothing) Then
If mscorlibAssembly.FullName.ToUpper.EndsWith("969DB8053D3322AC") Then
Return true
End If
End If
Return false
End Function
End Class
End Namespace
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -