Operator '=' on System.DateTime and System.Double

  • Thread starter Thread starter googlegroups
  • Start date Start date
G

googlegroups

I'm developeing a small app based on the Visual Studio Beta 2 and the
DataGridView.

I'm trying to add a new row to a datatable programmatically and I keep
getting a strange error about not being able to use the '=' operator
between a System.DateTime and System.Double. I do not have a double
anywhere in my datatable and I've checked multiple times to make sure
that I'm passing the right value to the addnew method. Is this a MS
bug?
 
Hi,

The '=' operater has in VBNet another meaning than in C#.

In VBNet is it an assign and a evaluating operator.
In C# is it an assign operater.

Therefore my first question, what language are you using and if that is
VBNet, what kind the '=" is.

Cor
 
Hi,

You might show us table definition and code you are using to add a new row.
 
The table is one of 3 in a dataset that I built using the GUI.

Here is the table info:
Table Name: dtScores
dtGameDate - DateTime (part of key)
lTeam1 - Int16 (part of key)
lTeam2 - Int16 (part of key)
lGameNum - Int16 (part of key)
lScoreTeam1 - Int16
lScoreTeam2 - Int16

Here is the line of code that I'm using to try to add a new row to the
datatable:
dsData.dtScores.AdddtScoresRow(CType(oRow.Item("dtGameDate"), Date),
CShort(oRow.Item("lTeam1")), CShort(oRow.Item("lTeam2")), CShort(i), 0,
0)

oRow is a row in another datatable that I'm using to feed this dataset.
For what it's worth, I also tried replacing the first parameter with a
hard-coded date and I got the same error.

Thanks for your help!
 
(e-mail address removed) wrote in @g43g2000cwa.googlegroups.com:
dsData.dtScores.AdddtScoresRow(CType(oRow.Item("dtGameDate"), Date),
CShort(oRow.Item("lTeam1")), CShort(oRow.Item("lTeam2")), CShort(i), 0,
0)

If you built it with the GUI, I assume you mean its a typed dataset. IF so, why are you not using the
early bound typesafe column references?
 
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50215.44
'
' 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


<Serializable(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.ComponentModel.ToolboxItem(true), _

System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"),
_
System.Xml.Serialization.XmlRootAttribute("dsData"), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet"),
_

System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage",
"CA2240:ImplementISerializableCorrectly")> _
Partial Public Class dsData
Inherits System.Data.DataSet

Private tabledtTeamInfo As dtTeamInfoDataTable

Private tabledtScores As dtScoresDataTable

Private tabledtSchedule As dtScheduleDataTable

Private _schemaSerializationMode As
System.Data.SchemaSerializationMode =
System.Data.SchemaSerializationMode.IncludeSchema


<System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage",
"CA2214:DoNotCallOverridableMethodsInConstructors")> _
Public Sub New()
MyBase.New
Me.BeginInit
Me.InitClass
Dim schemaChangedHandler As
System.ComponentModel.CollectionChangeEventHandler = AddressOf
Me.SchemaChanged
AddHandler MyBase.Tables.CollectionChanged,
schemaChangedHandler
AddHandler MyBase.Relations.CollectionChanged,
schemaChangedHandler
Me.EndInit
End Sub


<System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Usage",
"CA2214:DoNotCallOverridableMethodsInConstructors")> _
Protected Sub New(ByVal info As
System.Runtime.Serialization.SerializationInfo, ByVal context As
System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
If (Me.IsBinarySerialized(info, context) = true) Then
Me.InitVars(false)
Dim schemaChangedHandler1 As
System.ComponentModel.CollectionChangeEventHandler = AddressOf
Me.SchemaChanged
AddHandler Me.Tables.CollectionChanged,
schemaChangedHandler1
AddHandler Me.Relations.CollectionChanged,
schemaChangedHandler1
Return
End If
Dim strSchema As String = CType(info.GetValue("XmlSchema",
GetType(String)),String)
If (Me.DetermineSchemaSerializationMode(info, context) =
System.Data.SchemaSerializationMode.IncludeSchema) Then
Dim ds As System.Data.DataSet = New System.Data.DataSet
ds.ReadXmlSchema(New System.Xml.XmlTextReader(New
System.IO.StringReader(strSchema)))
If (Not (ds.Tables("dtTeamInfo")) Is Nothing) Then
MyBase.Tables.Add(New
dtTeamInfoDataTable(ds.Tables("dtTeamInfo")))
End If
If (Not (ds.Tables("dtScores")) Is Nothing) Then
MyBase.Tables.Add(New
dtScoresDataTable(ds.Tables("dtScores")))
End If
If (Not (ds.Tables("dtSchedule")) Is Nothing) Then
MyBase.Tables.Add(New
dtScheduleDataTable(ds.Tables("dtSchedule")))
End If
Me.DataSetName = ds.DataSetName
Me.Prefix = ds.Prefix
Me.Namespace = ds.Namespace
Me.Locale = ds.Locale
Me.CaseSensitive = ds.CaseSensitive
Me.EnforceConstraints = ds.EnforceConstraints
Me.Merge(ds, false, System.Data.MissingSchemaAction.Add)
Me.InitVars
Else
Me.ReadXmlSchema(New System.Xml.XmlTextReader(New
System.IO.StringReader(strSchema)))
End If
Me.GetSerializationData(info, context)
Dim schemaChangedHandler As
System.ComponentModel.CollectionChangeEventHandler = AddressOf
Me.SchemaChanged
AddHandler MyBase.Tables.CollectionChanged,
schemaChangedHandler
AddHandler Me.Relations.CollectionChanged, schemaChangedHandler
End Sub

<System.ComponentModel.Browsable(false), _

System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)>
_
Public ReadOnly Property dtTeamInfo() As dtTeamInfoDataTable
Get
Return Me.tabledtTeamInfo
End Get
End Property

<System.ComponentModel.Browsable(false), _

System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)>
_
Public ReadOnly Property dtScores() As dtScoresDataTable
Get
Return Me.tabledtScores
End Get
End Property

<System.ComponentModel.Browsable(false), _

System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)>
_
Public ReadOnly Property dtSchedule() As dtScheduleDataTable
Get
Return Me.tabledtSchedule
End Get
End Property

Public Overrides Property SchemaSerializationMode() As
System.Data.SchemaSerializationMode
Get
Return Me._schemaSerializationMode
End Get
Set
Me._schemaSerializationMode = value
End Set
End Property


<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>
_
Public Shadows ReadOnly Property Tables() As
System.Data.DataTableCollection
Get
Return MyBase.Tables
End Get
End Property


<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)>
_
Public Shadows ReadOnly Property Relations() As
System.Data.DataRelationCollection
Get
Return MyBase.Relations
End Get
End Property

<System.ComponentModel.DefaultValueAttribute(true)> _
Public Shadows Property EnforceConstraints() As Boolean
Get
Return MyBase.EnforceConstraints
End Get
Set
MyBase.EnforceConstraints = value
End Set
End Property

Protected Overrides Sub InitializeDerivedDataSet()
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

Public Overrides Function Clone() As System.Data.DataSet
Dim cln As dsData = CType(MyBase.Clone,dsData)
cln.InitVars
Return cln
End Function

Protected Overrides Function ShouldSerializeTables() As Boolean
Return false
End Function

Protected Overrides Function ShouldSerializeRelations() As Boolean
Return false
End Function

Protected Overrides Sub ReadXmlSerializable(ByVal reader As
System.Xml.XmlReader)
If (Me.DetermineSchemaSerializationMode(reader) =
System.Data.SchemaSerializationMode.IncludeSchema) Then
Me.Reset
Dim ds As System.Data.DataSet = New System.Data.DataSet
ds.ReadXml(reader)
If (Not (ds.Tables("dtTeamInfo")) Is Nothing) Then
MyBase.Tables.Add(New
dtTeamInfoDataTable(ds.Tables("dtTeamInfo")))
End If
If (Not (ds.Tables("dtScores")) Is Nothing) Then
MyBase.Tables.Add(New
dtScoresDataTable(ds.Tables("dtScores")))
End If
If (Not (ds.Tables("dtSchedule")) Is Nothing) Then
MyBase.Tables.Add(New
dtScheduleDataTable(ds.Tables("dtSchedule")))
End If
Me.DataSetName = ds.DataSetName
Me.Prefix = ds.Prefix
Me.Namespace = ds.Namespace
Me.Locale = ds.Locale
Me.CaseSensitive = ds.CaseSensitive
Me.EnforceConstraints = ds.EnforceConstraints
Me.Merge(ds, false, System.Data.MissingSchemaAction.Add)
Me.InitVars
Else
Me.ReadXml(reader)
Me.InitVars
End If
End Sub

Protected Overrides Function GetSchemaSerializable() As
System.Xml.Schema.XmlSchema
Dim stream As System.IO.MemoryStream = New
System.IO.MemoryStream
Me.WriteXmlSchema(New System.Xml.XmlTextWriter(stream,
Nothing))
stream.Position = 0
Return System.Xml.Schema.XmlSchema.Read(New
System.Xml.XmlTextReader(stream), Nothing)
End Function

Friend Overloads Sub InitVars()
Me.InitVars(true)
End Sub

Friend Overloads Sub InitVars(ByVal initTable As Boolean)
Me.tabledtTeamInfo =
CType(MyBase.Tables("dtTeamInfo"),dtTeamInfoDataTable)
If (initTable = true) Then
If (Not (Me.tabledtTeamInfo) Is Nothing) Then
Me.tabledtTeamInfo.InitVars
End If
End If
Me.tabledtScores =
CType(MyBase.Tables("dtScores"),dtScoresDataTable)
If (initTable = true) Then
If (Not (Me.tabledtScores) Is Nothing) Then
Me.tabledtScores.InitVars
End If
End If
Me.tabledtSchedule =
CType(MyBase.Tables("dtSchedule"),dtScheduleDataTable)
If (initTable = true) Then
If (Not (Me.tabledtSchedule) Is Nothing) Then
Me.tabledtSchedule.InitVars
End If
End If
End Sub

Private Sub InitClass()
Me.DataSetName = "dsData"
Me.Prefix = ""
Me.Namespace = "http://tempuri.org/dsData.xsd"
Me.EnforceConstraints = true
Me.tabledtTeamInfo = New dtTeamInfoDataTable
MyBase.Tables.Add(Me.tabledtTeamInfo)
Me.tabledtScores = New dtScoresDataTable
MyBase.Tables.Add(Me.tabledtScores)
Me.tabledtSchedule = New dtScheduleDataTable
MyBase.Tables.Add(Me.tabledtSchedule)
End Sub

Private Function ShouldSerializedtTeamInfo() As Boolean
Return false
End Function

Private Function ShouldSerializedtScores() As Boolean
Return false
End Function

Private Function ShouldSerializedtSchedule() As Boolean
Return false
End Function

Private Sub SchemaChanged(ByVal sender As Object, ByVal e As
System.ComponentModel.CollectionChangeEventArgs)
If (e.Action =
System.ComponentModel.CollectionChangeAction.Remove) Then
Me.InitVars
End If
End Sub

Public Shared Function GetTypedDataSetSchema(ByVal xs As
System.Xml.Schema.XmlSchemaSet) As
System.Xml.Schema.XmlSchemaComplexType
Dim ds As dsData = New dsData
Dim type As System.Xml.Schema.XmlSchemaComplexType = New
System.Xml.Schema.XmlSchemaComplexType
Dim sequence As System.Xml.Schema.XmlSchemaSequence = New
System.Xml.Schema.XmlSchemaSequence
xs.Add(ds.GetSchemaSerializable)
Dim any As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any.Namespace = ds.Namespace
sequence.Items.Add(any)
type.Particle = sequence
Return type
End Function

Public Delegate Sub dtTeamInfoRowChangeEventHandler(ByVal sender As
Object, ByVal e As dtTeamInfoRowChangeEvent)

Public Delegate Sub dtScoresRowChangeEventHandler(ByVal sender As
Object, ByVal e As dtScoresRowChangeEvent)

Public Delegate Sub dtScheduleRowChangeEventHandler(ByVal sender As
Object, ByVal e As dtScheduleRowChangeEvent)

<System.Serializable(), _

System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")>
_
Partial Public Class dtTeamInfoDataTable
Inherits System.Data.DataTable
Implements System.Collections.IEnumerable

Private columnlTeamNum As System.Data.DataColumn

Private columnsCaptainName As System.Data.DataColumn

Public Sub New()
MyBase.New
Me.TableName = "dtTeamInfo"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

Friend Sub New(ByVal table As System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive)
Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString)
Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub

Protected Sub New(ByVal info As
System.Runtime.Serialization.SerializationInfo, ByVal context As
System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub

Public ReadOnly Property lTeamNumColumn() As
System.Data.DataColumn
Get
Return Me.columnlTeamNum
End Get
End Property

Public ReadOnly Property sCaptainNameColumn() As
System.Data.DataColumn
Get
Return Me.columnsCaptainName
End Get
End Property

<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property

Public Default ReadOnly Property Item(ByVal index As Integer)
As dtTeamInfoRow
Get
Return CType(Me.Rows(index),dtTeamInfoRow)
End Get
End Property

Public Event dtTeamInfoRowChanged As
dtTeamInfoRowChangeEventHandler

Public Event dtTeamInfoRowChanging As
dtTeamInfoRowChangeEventHandler

Public Event dtTeamInfoRowDeleted As
dtTeamInfoRowChangeEventHandler

Public Event dtTeamInfoRowDeleting As
dtTeamInfoRowChangeEventHandler

Public Overloads Sub AdddtTeamInfoRow(ByVal row As
dtTeamInfoRow)
Me.Rows.Add(row)
End Sub

Public Overloads Function AdddtTeamInfoRow(ByVal sCaptainName
As String) As dtTeamInfoRow
Dim rowdtTeamInfoRow As dtTeamInfoRow =
CType(Me.NewRow,dtTeamInfoRow)
rowdtTeamInfoRow.ItemArray = New Object() {Nothing,
sCaptainName}
Me.Rows.Add(rowdtTeamInfoRow)
Return rowdtTeamInfoRow
End Function

Public Function FindBylTeamNum(ByVal lTeamNum As Integer) As
dtTeamInfoRow
Return CType(Me.Rows.Find(New Object()
{lTeamNum}),dtTeamInfoRow)
End Function

Public Overridable Function GetEnumerator() As
System.Collections.IEnumerator Implements
System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function

Public Overrides Function Clone() As System.Data.DataTable
Dim cln As dtTeamInfoDataTable =
CType(MyBase.Clone,dtTeamInfoDataTable)
cln.InitVars
Return cln
End Function

Protected Overrides Function CreateInstance() As
System.Data.DataTable
Return New dtTeamInfoDataTable
End Function

Friend Sub InitVars()
Me.columnlTeamNum = MyBase.Columns("lTeamNum")
Me.columnsCaptainName = MyBase.Columns("sCaptainName")
End Sub

Private Sub InitClass()
Me.columnlTeamNum = New System.Data.DataColumn("lTeamNum",
GetType(Integer), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlTeamNum)
Me.columnsCaptainName = New
System.Data.DataColumn("sCaptainName", GetType(String), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnsCaptainName)
Me.Constraints.Add(New
System.Data.UniqueConstraint("dtTeamInfoKey1", New
System.Data.DataColumn() {Me.columnlTeamNum}, true))
Me.columnlTeamNum.AutoIncrement = true
Me.columnlTeamNum.AutoIncrementSeed = 1
Me.columnlTeamNum.AllowDBNull = false
Me.columnlTeamNum.Unique = true
Me.columnsCaptainName.AllowDBNull = false
End Sub

Public Function NewdtTeamInfoRow() As dtTeamInfoRow
Return CType(Me.NewRow,dtTeamInfoRow)
End Function

Protected Overrides Function NewRowFromBuilder(ByVal builder As
System.Data.DataRowBuilder) As System.Data.DataRow
Return New dtTeamInfoRow(builder)
End Function

Protected Overrides Function GetRowType() As System.Type
Return GetType(dtTeamInfoRow)
End Function

Protected Overrides Sub OnRowChanged(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.dtTeamInfoRowChangedEvent) Is Nothing) Then
RaiseEvent dtTeamInfoRowChanged(Me, New
dtTeamInfoRowChangeEvent(CType(e.Row,dtTeamInfoRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowChanging(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.dtTeamInfoRowChangingEvent) Is Nothing) Then
RaiseEvent dtTeamInfoRowChanging(Me, New
dtTeamInfoRowChangeEvent(CType(e.Row,dtTeamInfoRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleted(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.dtTeamInfoRowDeletedEvent) Is Nothing) Then
RaiseEvent dtTeamInfoRowDeleted(Me, New
dtTeamInfoRowChangeEvent(CType(e.Row,dtTeamInfoRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleting(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.dtTeamInfoRowDeletingEvent) Is Nothing) Then
RaiseEvent dtTeamInfoRowDeleting(Me, New
dtTeamInfoRowChangeEvent(CType(e.Row,dtTeamInfoRow), e.Action))
End If
End Sub

Public Sub RemovedtTeamInfoRow(ByVal row As dtTeamInfoRow)
Me.Rows.Remove(row)
End Sub

Public Shared Function GetTypedTableSchema(ByVal xs As
System.Xml.Schema.XmlSchemaSet) As
System.Xml.Schema.XmlSchemaComplexType
Dim type As System.Xml.Schema.XmlSchemaComplexType = New
System.Xml.Schema.XmlSchemaComplexType
Dim sequence As System.Xml.Schema.XmlSchemaSequence = New
System.Xml.Schema.XmlSchemaSequence
Dim ds As dsData = New dsData
xs.Add(ds.GetSchemaSerializable)
Dim any1 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "dtTeamInfoDataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Return type
End Function
End Class

<System.Serializable(), _

System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")>
_
Partial Public Class dtScoresDataTable
Inherits System.Data.DataTable
Implements System.Collections.IEnumerable

Private columndtGameDate As System.Data.DataColumn

Private columnlTeam1 As System.Data.DataColumn

Private columnlTeam2 As System.Data.DataColumn

Private columnlGameNum As System.Data.DataColumn

Private columnlScoreTeam1 As System.Data.DataColumn

Private columnlScoreTeam2 As System.Data.DataColumn

Public Sub New()
MyBase.New
Me.TableName = "dtScores"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

Friend Sub New(ByVal table As System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive)
Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString)
Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub

Protected Sub New(ByVal info As
System.Runtime.Serialization.SerializationInfo, ByVal context As
System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub

Public ReadOnly Property dtGameDateColumn() As
System.Data.DataColumn
Get
Return Me.columndtGameDate
End Get
End Property

Public ReadOnly Property lTeam1Column() As
System.Data.DataColumn
Get
Return Me.columnlTeam1
End Get
End Property

Public ReadOnly Property lTeam2Column() As
System.Data.DataColumn
Get
Return Me.columnlTeam2
End Get
End Property

Public ReadOnly Property lGameNumColumn() As
System.Data.DataColumn
Get
Return Me.columnlGameNum
End Get
End Property

Public ReadOnly Property lScoreTeam1Column() As
System.Data.DataColumn
Get
Return Me.columnlScoreTeam1
End Get
End Property

Public ReadOnly Property lScoreTeam2Column() As
System.Data.DataColumn
Get
Return Me.columnlScoreTeam2
End Get
End Property

<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property

Public Default ReadOnly Property Item(ByVal index As Integer)
As dtScoresRow
Get
Return CType(Me.Rows(index),dtScoresRow)
End Get
End Property

Public Event dtScoresRowChanged As
dtScoresRowChangeEventHandler

Public Event dtScoresRowChanging As
dtScoresRowChangeEventHandler

Public Event dtScoresRowDeleted As
dtScoresRowChangeEventHandler

Public Event dtScoresRowDeleting As
dtScoresRowChangeEventHandler

Public Overloads Sub AdddtScoresRow(ByVal row As dtScoresRow)
Me.Rows.Add(row)
End Sub

Public Overloads Function AdddtScoresRow(ByVal dtGameDate As
Date, ByVal lTeam1 As Short, ByVal lTeam2 As Short, ByVal lGameNum As
Short, ByVal lScoreTeam1 As Short, ByVal lScoreTeam2 As Short) As
dtScoresRow
Dim rowdtScoresRow As dtScoresRow =
CType(Me.NewRow,dtScoresRow)
rowdtScoresRow.ItemArray = New Object() {dtGameDate,
lTeam1, lTeam2, lGameNum, lScoreTeam1, lScoreTeam2}
Me.Rows.Add(rowdtScoresRow)
Return rowdtScoresRow
End Function

Public Function FindBydtGameDatelGameNumlTeam2lTeam1(ByVal
dtGameDate As Date, ByVal lGameNum As Short, ByVal lTeam2 As Short,
ByVal lTeam1 As Short) As dtScoresRow
Return CType(Me.Rows.Find(New Object() {dtGameDate,
lGameNum, lTeam2, lTeam1}),dtScoresRow)
End Function

Public Overridable Function GetEnumerator() As
System.Collections.IEnumerator Implements
System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function

Public Overrides Function Clone() As System.Data.DataTable
Dim cln As dtScoresDataTable =
CType(MyBase.Clone,dtScoresDataTable)
cln.InitVars
Return cln
End Function

Protected Overrides Function CreateInstance() As
System.Data.DataTable
Return New dtScoresDataTable
End Function

Friend Sub InitVars()
Me.columndtGameDate = MyBase.Columns("dtGameDate")
Me.columnlTeam1 = MyBase.Columns("lTeam1")
Me.columnlTeam2 = MyBase.Columns("lTeam2")
Me.columnlGameNum = MyBase.Columns("lGameNum")
Me.columnlScoreTeam1 = MyBase.Columns("lScoreTeam1")
Me.columnlScoreTeam2 = MyBase.Columns("lScoreTeam2")
End Sub

Private Sub InitClass()
Me.columndtGameDate = New
System.Data.DataColumn("dtGameDate", GetType(Date), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columndtGameDate)
Me.columnlTeam1 = New System.Data.DataColumn("lTeam1",
GetType(Short), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlTeam1)
Me.columnlTeam2 = New System.Data.DataColumn("lTeam2",
GetType(Short), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlTeam2)
Me.columnlGameNum = New System.Data.DataColumn("lGameNum",
GetType(Short), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlGameNum)
Me.columnlScoreTeam1 = New
System.Data.DataColumn("lScoreTeam1", GetType(Short), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlScoreTeam1)
Me.columnlScoreTeam2 = New
System.Data.DataColumn("lScoreTeam2", GetType(Short), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlScoreTeam2)
Me.Constraints.Add(New
System.Data.UniqueConstraint("Constraint1", New
System.Data.DataColumn() {Me.columndtGameDate, Me.columnlGameNum,
Me.columnlTeam2, Me.columnlTeam1}, true))
Me.Constraints.Add(New
System.Data.UniqueConstraint("Constraint2", New
System.Data.DataColumn() {Me.columndtGameDate, Me.columnlTeam1,
Me.columnlTeam2}, false))
Me.columndtGameDate.AllowDBNull = false
Me.columnlTeam1.AllowDBNull = false
Me.columnlTeam2.AllowDBNull = false
Me.columnlGameNum.AllowDBNull = false
End Sub

Public Function NewdtScoresRow() As dtScoresRow
Return CType(Me.NewRow,dtScoresRow)
End Function

Protected Overrides Function NewRowFromBuilder(ByVal builder As
System.Data.DataRowBuilder) As System.Data.DataRow
Return New dtScoresRow(builder)
End Function

Protected Overrides Function GetRowType() As System.Type
Return GetType(dtScoresRow)
End Function

Protected Overrides Sub OnRowChanged(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.dtScoresRowChangedEvent) Is Nothing) Then
RaiseEvent dtScoresRowChanged(Me, New
dtScoresRowChangeEvent(CType(e.Row,dtScoresRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowChanging(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.dtScoresRowChangingEvent) Is Nothing) Then
RaiseEvent dtScoresRowChanging(Me, New
dtScoresRowChangeEvent(CType(e.Row,dtScoresRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleted(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.dtScoresRowDeletedEvent) Is Nothing) Then
RaiseEvent dtScoresRowDeleted(Me, New
dtScoresRowChangeEvent(CType(e.Row,dtScoresRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleting(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.dtScoresRowDeletingEvent) Is Nothing) Then
RaiseEvent dtScoresRowDeleting(Me, New
dtScoresRowChangeEvent(CType(e.Row,dtScoresRow), e.Action))
End If
End Sub

Public Sub RemovedtScoresRow(ByVal row As dtScoresRow)
Me.Rows.Remove(row)
End Sub

Public Shared Function GetTypedTableSchema(ByVal xs As
System.Xml.Schema.XmlSchemaSet) As
System.Xml.Schema.XmlSchemaComplexType
Dim type As System.Xml.Schema.XmlSchemaComplexType = New
System.Xml.Schema.XmlSchemaComplexType
Dim sequence As System.Xml.Schema.XmlSchemaSequence = New
System.Xml.Schema.XmlSchemaSequence
Dim ds As dsData = New dsData
xs.Add(ds.GetSchemaSerializable)
Dim any1 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "dtScoresDataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Return type
End Function
End Class

<System.Serializable(), _

System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")>
_
Partial Public Class dtScheduleDataTable
Inherits System.Data.DataTable
Implements System.Collections.IEnumerable

Private columndtGameDate As System.Data.DataColumn

Private columnlTeam1 As System.Data.DataColumn

Private columnlTeam2 As System.Data.DataColumn

Private columnlNumGames As System.Data.DataColumn

Public Sub New()
MyBase.New
Me.TableName = "dtSchedule"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

Friend Sub New(ByVal table As System.Data.DataTable)
MyBase.New
Me.TableName = table.TableName
If (table.CaseSensitive <> table.DataSet.CaseSensitive)
Then
Me.CaseSensitive = table.CaseSensitive
End If
If (table.Locale.ToString <> table.DataSet.Locale.ToString)
Then
Me.Locale = table.Locale
End If
If (table.Namespace <> table.DataSet.Namespace) Then
Me.Namespace = table.Namespace
End If
Me.Prefix = table.Prefix
Me.MinimumCapacity = table.MinimumCapacity
End Sub

Protected Sub New(ByVal info As
System.Runtime.Serialization.SerializationInfo, ByVal context As
System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context)
Me.InitVars
End Sub

Public ReadOnly Property dtGameDateColumn() As
System.Data.DataColumn
Get
Return Me.columndtGameDate
End Get
End Property

Public ReadOnly Property lTeam1Column() As
System.Data.DataColumn
Get
Return Me.columnlTeam1
End Get
End Property

Public ReadOnly Property lTeam2Column() As
System.Data.DataColumn
Get
Return Me.columnlTeam2
End Get
End Property

Public ReadOnly Property lNumGamesColumn() As
System.Data.DataColumn
Get
Return Me.columnlNumGames
End Get
End Property

<System.ComponentModel.Browsable(false)> _
Public ReadOnly Property Count() As Integer
Get
Return Me.Rows.Count
End Get
End Property

Public Default ReadOnly Property Item(ByVal index As Integer)
As dtScheduleRow
Get
Return CType(Me.Rows(index),dtScheduleRow)
End Get
End Property

Public Event dtScheduleRowChanged As
dtScheduleRowChangeEventHandler

Public Event dtScheduleRowChanging As
dtScheduleRowChangeEventHandler

Public Event dtScheduleRowDeleted As
dtScheduleRowChangeEventHandler

Public Event dtScheduleRowDeleting As
dtScheduleRowChangeEventHandler

Public Overloads Sub AdddtScheduleRow(ByVal row As
dtScheduleRow)
Me.Rows.Add(row)
End Sub

Public Overloads Function AdddtScheduleRow(ByVal dtGameDate As
Date, ByVal lTeam1 As Short, ByVal lTeam2 As Short, ByVal lNumGames As
Short) As dtScheduleRow
Dim rowdtScheduleRow As dtScheduleRow =
CType(Me.NewRow,dtScheduleRow)
rowdtScheduleRow.ItemArray = New Object() {dtGameDate,
lTeam1, lTeam2, lNumGames}
Me.Rows.Add(rowdtScheduleRow)
Return rowdtScheduleRow
End Function

Public Function FindBydtGameDatelTeam2lTeam1(ByVal dtGameDate
As Date, ByVal lTeam2 As Short, ByVal lTeam1 As Short) As dtScheduleRow
Return CType(Me.Rows.Find(New Object() {dtGameDate, lTeam2,
lTeam1}),dtScheduleRow)
End Function

Public Overridable Function GetEnumerator() As
System.Collections.IEnumerator Implements
System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function

Public Overrides Function Clone() As System.Data.DataTable
Dim cln As dtScheduleDataTable =
CType(MyBase.Clone,dtScheduleDataTable)
cln.InitVars
Return cln
End Function

Protected Overrides Function CreateInstance() As
System.Data.DataTable
Return New dtScheduleDataTable
End Function

Friend Sub InitVars()
Me.columndtGameDate = MyBase.Columns("dtGameDate")
Me.columnlTeam1 = MyBase.Columns("lTeam1")
Me.columnlTeam2 = MyBase.Columns("lTeam2")
Me.columnlNumGames = MyBase.Columns("lNumGames")
End Sub

Private Sub InitClass()
Me.columndtGameDate = New
System.Data.DataColumn("dtGameDate", GetType(Date), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columndtGameDate)
Me.columnlTeam1 = New System.Data.DataColumn("lTeam1",
GetType(Short), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlTeam1)
Me.columnlTeam2 = New System.Data.DataColumn("lTeam2",
GetType(Short), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlTeam2)
Me.columnlNumGames = New
System.Data.DataColumn("lNumGames", GetType(Short), Nothing,
System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnlNumGames)
Me.Constraints.Add(New
System.Data.UniqueConstraint("Constraint1", New
System.Data.DataColumn() {Me.columndtGameDate, Me.columnlTeam2,
Me.columnlTeam1}, true))
Me.columndtGameDate.AllowDBNull = false
Me.columnlTeam1.AllowDBNull = false
Me.columnlTeam2.AllowDBNull = false
End Sub

Public Function NewdtScheduleRow() As dtScheduleRow
Return CType(Me.NewRow,dtScheduleRow)
End Function

Protected Overrides Function NewRowFromBuilder(ByVal builder As
System.Data.DataRowBuilder) As System.Data.DataRow
Return New dtScheduleRow(builder)
End Function

Protected Overrides Function GetRowType() As System.Type
Return GetType(dtScheduleRow)
End Function

Protected Overrides Sub OnRowChanged(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.dtScheduleRowChangedEvent) Is Nothing) Then
RaiseEvent dtScheduleRowChanged(Me, New
dtScheduleRowChangeEvent(CType(e.Row,dtScheduleRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowChanging(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.dtScheduleRowChangingEvent) Is Nothing) Then
RaiseEvent dtScheduleRowChanging(Me, New
dtScheduleRowChangeEvent(CType(e.Row,dtScheduleRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleted(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.dtScheduleRowDeletedEvent) Is Nothing) Then
RaiseEvent dtScheduleRowDeleted(Me, New
dtScheduleRowChangeEvent(CType(e.Row,dtScheduleRow), e.Action))
End If
End Sub

Protected Overrides Sub OnRowDeleting(ByVal e As
System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.dtScheduleRowDeletingEvent) Is Nothing) Then
RaiseEvent dtScheduleRowDeleting(Me, New
dtScheduleRowChangeEvent(CType(e.Row,dtScheduleRow), e.Action))
End If
End Sub

Public Sub RemovedtScheduleRow(ByVal row As dtScheduleRow)
Me.Rows.Remove(row)
End Sub

Public Shared Function GetTypedTableSchema(ByVal xs As
System.Xml.Schema.XmlSchemaSet) As
System.Xml.Schema.XmlSchemaComplexType
Dim type As System.Xml.Schema.XmlSchemaComplexType = New
System.Xml.Schema.XmlSchemaComplexType
Dim sequence As System.Xml.Schema.XmlSchemaSequence = New
System.Xml.Schema.XmlSchemaSequence
Dim ds As dsData = New dsData
xs.Add(ds.GetSchemaSerializable)
Dim any1 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any1.Namespace = "http://www.w3.org/2001/XMLSchema"
any1.MinOccurs = New Decimal(0)
any1.MaxOccurs = Decimal.MaxValue
any1.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any1)
Dim any2 As System.Xml.Schema.XmlSchemaAny = New
System.Xml.Schema.XmlSchemaAny
any2.Namespace =
"urn:schemas-microsoft-com:xml-diffgram-v1"
any2.MinOccurs = New Decimal(1)
any2.ProcessContents =
System.Xml.Schema.XmlSchemaContentProcessing.Lax
sequence.Items.Add(any2)
Dim attribute1 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute1.Name = "namespace"
attribute1.FixedValue = ds.Namespace
type.Attributes.Add(attribute1)
Dim attribute2 As System.Xml.Schema.XmlSchemaAttribute =
New System.Xml.Schema.XmlSchemaAttribute
attribute2.Name = "tableTypeName"
attribute2.FixedValue = "dtScheduleDataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Return type
End Function
End Class

Partial Public Class dtTeamInfoRow
Inherits System.Data.DataRow

Private tabledtTeamInfo As dtTeamInfoDataTable

Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tabledtTeamInfo = CType(Me.Table,dtTeamInfoDataTable)
End Sub

Public Property lTeamNum() As Integer
Get
Return
CType(Me(Me.tabledtTeamInfo.lTeamNumColumn),Integer)
End Get
Set
Me(Me.tabledtTeamInfo.lTeamNumColumn) = value
End Set
End Property

Public Property sCaptainName() As String
Get
Return
CType(Me(Me.tabledtTeamInfo.sCaptainNameColumn),String)
End Get
Set
Me(Me.tabledtTeamInfo.sCaptainNameColumn) = value
End Set
End Property
End Class

Partial Public Class dtScoresRow
Inherits System.Data.DataRow

Private tabledtScores As dtScoresDataTable

Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tabledtScores = CType(Me.Table,dtScoresDataTable)
End Sub

Public Property dtGameDate() As Date
Get
Return
CType(Me(Me.tabledtScores.dtGameDateColumn),Date)
End Get
Set
Me(Me.tabledtScores.dtGameDateColumn) = value
End Set
End Property

Public Property lTeam1() As Short
Get
Return CType(Me(Me.tabledtScores.lTeam1Column),Short)
End Get
Set
Me(Me.tabledtScores.lTeam1Column) = value
End Set
End Property

Public Property lTeam2() As Short
Get
Return CType(Me(Me.tabledtScores.lTeam2Column),Short)
End Get
Set
Me(Me.tabledtScores.lTeam2Column) = value
End Set
End Property

Public Property lGameNum() As Short
Get
Return CType(Me(Me.tabledtScores.lGameNumColumn),Short)
End Get
Set
Me(Me.tabledtScores.lGameNumColumn) = value
End Set
End Property

Public Property lScoreTeam1() As Short
Get
Try
Return
CType(Me(Me.tabledtScores.lScoreTeam1Column),Short)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("The
value for column 'lScoreTeam1' in table 'dtScores' is DBNull.", e)
End Try
End Get
Set
Me(Me.tabledtScores.lScoreTeam1Column) = value
End Set
End Property

Public Property lScoreTeam2() As Short
Get
Try
Return
CType(Me(Me.tabledtScores.lScoreTeam2Column),Short)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("The
value for column 'lScoreTeam2' in table 'dtScores' is DBNull.", e)
End Try
End Get
Set
Me(Me.tabledtScores.lScoreTeam2Column) = value
End Set
End Property

Public Function IslScoreTeam1Null() As Boolean
Return Me.IsNull(Me.tabledtScores.lScoreTeam1Column)
End Function

Public Sub SetlScoreTeam1Null()
Me(Me.tabledtScores.lScoreTeam1Column) =
System.Convert.DBNull
End Sub

Public Function IslScoreTeam2Null() As Boolean
Return Me.IsNull(Me.tabledtScores.lScoreTeam2Column)
End Function

Public Sub SetlScoreTeam2Null()
Me(Me.tabledtScores.lScoreTeam2Column) =
System.Convert.DBNull
End Sub
End Class

Partial Public Class dtScheduleRow
Inherits System.Data.DataRow

Private tabledtSchedule As dtScheduleDataTable

Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tabledtSchedule = CType(Me.Table,dtScheduleDataTable)
End Sub

Public Property dtGameDate() As Date
Get
Return
CType(Me(Me.tabledtSchedule.dtGameDateColumn),Date)
End Get
Set
Me(Me.tabledtSchedule.dtGameDateColumn) = value
End Set
End Property

Public Property lTeam1() As Short
Get
Return CType(Me(Me.tabledtSchedule.lTeam1Column),Short)
End Get
Set
Me(Me.tabledtSchedule.lTeam1Column) = value
End Set
End Property

Public Property lTeam2() As Short
Get
Return CType(Me(Me.tabledtSchedule.lTeam2Column),Short)
End Get
Set
Me(Me.tabledtSchedule.lTeam2Column) = value
End Set
End Property

Public Property lNumGames() As Short
Get
Try
Return
CType(Me(Me.tabledtSchedule.lNumGamesColumn),Short)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("The
value for column 'lNumGames' in table 'dtSchedule' is DBNull.", e)
End Try
End Get
Set
Me(Me.tabledtSchedule.lNumGamesColumn) = value
End Set
End Property

Public Function IslNumGamesNull() As Boolean
Return Me.IsNull(Me.tabledtSchedule.lNumGamesColumn)
End Function

Public Sub SetlNumGamesNull()
Me(Me.tabledtSchedule.lNumGamesColumn) =
System.Convert.DBNull
End Sub
End Class

Public Class dtTeamInfoRowChangeEvent
Inherits System.EventArgs

Private eventRow As dtTeamInfoRow

Private eventAction As System.Data.DataRowAction

Public Sub New(ByVal row As dtTeamInfoRow, ByVal action As
System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub

Public ReadOnly Property Row() As dtTeamInfoRow
Get
Return Me.eventRow
End Get
End Property

Public ReadOnly Property Action() As System.Data.DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class

Public Class dtScoresRowChangeEvent
Inherits System.EventArgs

Private eventRow As dtScoresRow

Private eventAction As System.Data.DataRowAction

Public Sub New(ByVal row As dtScoresRow, ByVal action As
System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub

Public ReadOnly Property Row() As dtScoresRow
Get
Return Me.eventRow
End Get
End Property

Public ReadOnly Property Action() As System.Data.DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class

Public Class dtScheduleRowChangeEvent
Inherits System.EventArgs

Private eventRow As dtScheduleRow

Private eventAction As System.Data.DataRowAction

Public Sub New(ByVal row As dtScheduleRow, ByVal action As
System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub

Public ReadOnly Property Row() As dtScheduleRow
Get
Return Me.eventRow
End Get
End Property

Public ReadOnly Property Action() As System.Data.DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
End Class
 
Actually, I did say that I was using the VS 2005 beta 2, which is on
the 2.0 framework. I also said that I'm using the datagridview. I
will email you the code, so you can look at it. I'm not sure what
"repro" means, sorry.
 
Wrong key..

I did this:
Dim x As New dsData
x.dtScores.AdddtScoresRow(New Date(2000, 1, 1), 1, 1, 1, 1, 1)

and it works without a problem. Perhaps it is one of your parameters causing
the problem?
 
Found the answer. I just needed to call BeginLoadData on the datatable
before trying to add a row to the dataset. Apparrently, something with
the binding was causing the error. Strange, but at least the solution
was simple. Thanks again guys for your help!
 
Okay, false alarm. I'm still getting the error. Like you said, I can
create a NEW dataset and everything works fine. However, when I try to
add to the existing one created by the designer, I get the error. I've
tried recreating the dataset from scratch. I've tried renaming it. I
don't know what else to try. Here is the stack trace from the error:

StackTrace " at System.Data.BinaryNode.SetTypeMismatchError(Int32 op,
Type left, Type right)
at System.Data.BinaryNode.BinaryCompare(Object vLeft, Object vRight,
StorageType resultType, Int32 op)
at System.Data.BinaryNode.EvalBinaryOp(Int32 op, ExpressionNode
left, ExpressionNode right, DataRow row, DataRowVersion version,
Int32[] recordNos)
at System.Data.BinaryNode.Eval(DataRow row, DataRowVersion version)
at System.Data.DataExpression.Invoke(DataRow row, DataRowVersion
version)
at System.Data.Index.AcceptRecord(Int32 record)
at System.Data.Index.InitRecords()
at System.Data.DataTable.ResetInternalIndexes()
at System.Data.Merger.MergeTable(DataTable src, DataTable dst)
at System.Data.Merger.MergeTableData(DataTable src)
at System.Data.Merger.MergeTable(DataTable src)
at System.Data.DataTable.Merge(DataTable table, Boolean
preserveChanges, MissingSchemaAction missingSchemaAction)
at System.Data.DataTable.Merge(DataTable table)
at xxxxxxx.Main.UpdateScoresTable() in

It looks like it's trying to do some kind of compare behind the scenes
and for some reason, it thinks there is a "double" in there somewhere.
Any more ideas?
 
Create a simple working sample that demonstrates the behaviour (complete
project). As simple as possible and send it to me (again :-))
 
I was in the process of putting together a repro and I figured out the
source of the problem. I had a filter on the DataGridView that was
bound to the dataset and I didn't put quotes around the date string.
Thanks again for your help.
 
Back
Top