AndrasEliassen

I am making a webservice that is controlling communication between my DAL and client.

I retrieve data using DataSets and tableAdapters. In one of my tableAdapters I have a DateTime column that allows nulls.

But my tableAdapter throws an error if that column indeed is null.:

The value for column 'Deadline' in table 'Tasks' is DBNull.

So I want to go to my designer.vb file, but there is no vb file in the directory where the other files are.

I don't understand this. There must be one

I also made a local hard drive search for all files called dsTasksData* (it should be called something like dsTasksData.Designer.vb) but it doesn't find it.

The closest one it finds is:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\ismswebservice\04475f37\589f1829\Sources_App_Code\dstasksdata.xsd.72cecc2a.vb

And this file seems to contain the code I'm searching for, but changes made in this file do not affect the webservice, it seemes...




Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

Yu Guo – MSFT

Hi, AndrasEliassen,

The tableAdapter could be exist in your DataSet1.Designer.vb file in your project folder.

it could be something like

Code Snippet

Namespace DataSet1TableAdapters

//……

Partial Public Class Table1TableAdapter

And you can retrieve them by

Code Snippet

DataSet1TableAdapters.Table1TableAdapter

Hopes this helps,

Regards






Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

AndrasEliassen

That's excactly the file I'm talking about - I can't find that .vb file.

I read on the internet somewhere that such a file is not made when you're making a webservice, and use the app_code folder

Could that be it

thanks






Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

Yu Guo – MSFT

Hi, AndrasEliassen,

I tried to create a webservice project, and the file appears when I add a dataset file into the project.

Are you using Visual Studio 2005

Regards






Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

AndrasEliassen

Yes VS 2005.

If so, is there a way that I can generate this file






Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

Yu Guo – MSFT

Hi, AndrasEliassen,

I am not sure how to generate the file manually.

But I think if you can see the tableadapter in your dataset designer,

the file should exist in your project.

I copy the codes here.

Code Snippet

'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:2.0.50727.832
'
' 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


<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), _
Serializable(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.ComponentModel.ToolboxItem(true), _
System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedDataSetSchema"), _
System.Xml.Serialization.XmlRootAttribute("DataSet1"), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.DataSet")> _
Partial Public Class DataSet1
Inherits System.Data.DataSet

Private tableTable1 As Table1DataTable

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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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.DebuggerNonUserCodeAttribute()> _
Protected Sub New(ByVal info As System.Runtime.Serialization.SerializationInfo, ByVal context As System.Runtime.Serialization.StreamingContext)
MyBase.New(info, context, false)
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("Table1")) Is Nothing) Then
MyBase.Tables.Add(New Table1DataTable(ds.Tables("Table1")))
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.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.Browsable(false), _
System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)> _
Public ReadOnly Property Table1() As Table1DataTable
Get
Return Me.tableTable1
End Get
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.BrowsableAttribute(true), _
System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Visible)> _
Public Overrides Property SchemaSerializationMode() As System.Data.SchemaSerializationMode
Get
Return Me._schemaSerializationMode
End Get
Set
Me._schemaSerializationMode = value
End Set
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
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.Diagnostics.DebuggerNonUserCodeAttribute(), _
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.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Sub InitializeDerivedDataSet()
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Overrides Function Clone() As System.Data.DataSet
Dim cln As DataSet1 = CType(MyBase.Clone,DataSet1)
cln.InitVars
cln.SchemaSerializationMode = Me.SchemaSerializationMode
Return cln
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Function ShouldSerializeTables() As Boolean
Return false
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Function ShouldSerializeRelations() As Boolean
Return false
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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("Table1")) Is Nothing) Then
MyBase.Tables.Add(New Table1DataTable(ds.Tables("Table1")))
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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Friend Overloads Sub InitVars()
Me.InitVars(true)
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Friend Overloads Sub InitVars(ByVal initTable As Boolean)
Me.tableTable1 = CType(MyBase.Tables("Table1"),Table1DataTable)
If (initTable = true) Then
If (Not (Me.tableTable1) Is Nothing) Then
Me.tableTable1.InitVars
End If
End If
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitClass()
Me.DataSetName = "DataSet1"
Me.Prefix = ""
Me.Namespace = "http://tempuri.org/DataSet1.xsd"
Me.EnforceConstraints = true
Me.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema
Me.tableTable1 = New Table1DataTable
MyBase.Tables.Add(Me.tableTable1)
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Function ShouldSerializeTable1() As Boolean
Return false
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Shared Function GetTypedDataSetSchema(ByVal xs As System.Xml.Schema.XmlSchemaSet) As System.Xml.Schema.XmlSchemaComplexType
Dim ds As DataSet1 = New DataSet1
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 Table1RowChangeEventHandler(ByVal sender As Object, ByVal e As Table1RowChangeEvent)

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), _
System.Serializable(), _
System.Xml.Serialization.XmlSchemaProviderAttribute("GetTypedTableSchema")> _
Partial Public Class Table1DataTable
Inherits System.Data.DataTable
Implements System.Collections.IEnumerable

Private columnID As System.Data.DataColumn

Private columnName As System.Data.DataColumn

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Sub New()
MyBase.New
Me.TableName = "Table1"
Me.BeginInit
Me.InitClass
Me.EndInit
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public ReadOnly Property IDColumn() As System.Data.DataColumn
Get
Return Me.columnID
End Get
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public ReadOnly Property NameColumn() As System.Data.DataColumn
Get
Return Me.columnName
End Get
End Property

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

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Default ReadOnly Property Item(ByVal index As Integer) As Table1Row
Get
Return CType(Me.Rows(index),Table1Row)
End Get
End Property

Public Event Table1RowChanging As Table1RowChangeEventHandler

Public Event Table1RowChanged As Table1RowChangeEventHandler

Public Event Table1RowDeleting As Table1RowChangeEventHandler

Public Event Table1RowDeleted As Table1RowChangeEventHandler

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Overloads Sub AddTable1Row(ByVal row As Table1Row)
Me.Rows.Add(row)
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Overloads Function AddTable1Row(ByVal Name As String) As Table1Row
Dim rowTable1Row As Table1Row = CType(Me.NewRow,Table1Row)
rowTable1Row.ItemArray = New Object() {Nothing, Name}
Me.Rows.Add(rowTable1Row)
Return rowTable1Row
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Function FindByID(ByVal ID As Integer) As Table1Row
Return CType(Me.Rows.Find(New Object() {ID}),Table1Row)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Overridable Function GetEnumerator() As System.Collections.IEnumerator Implements System.Collections.IEnumerable.GetEnumerator
Return Me.Rows.GetEnumerator
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Overrides Function Clone() As System.Data.DataTable
Dim cln As Table1DataTable = CType(MyBase.Clone,Table1DataTable)
cln.InitVars
Return cln
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Function CreateInstance() As System.Data.DataTable
Return New Table1DataTable
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Friend Sub InitVars()
Me.columnID = MyBase.Columns("ID")
Me.columnName = MyBase.Columns("Name")
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitClass()
Me.columnID = New System.Data.DataColumn("ID", GetType(Integer), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnID)
Me.columnName = New System.Data.DataColumn("Name", GetType(String), Nothing, System.Data.MappingType.Element)
MyBase.Columns.Add(Me.columnName)
Me.Constraints.Add(New System.Data.UniqueConstraint("Constraint1", New System.Data.DataColumn() {Me.columnID}, true))
Me.columnID.AutoIncrement = true
Me.columnID.AllowDBNull = false
Me.columnID.Unique = true
Me.columnName.MaxLength = 255
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Function NewTable1Row() As Table1Row
Return CType(Me.NewRow,Table1Row)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Function NewRowFromBuilder(ByVal builder As System.Data.DataRowBuilder) As System.Data.DataRow
Return New Table1Row(builder)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Function GetRowType() As System.Type
Return GetType(Table1Row)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Sub OnRowChanged(ByVal e As System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanged(e)
If (Not (Me.Table1RowChangedEvent) Is Nothing) Then
RaiseEvent Table1RowChanged(Me, New Table1RowChangeEvent(CType(e.Row,Table1Row), e.Action))
End If
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Sub OnRowChanging(ByVal e As System.Data.DataRowChangeEventArgs)
MyBase.OnRowChanging(e)
If (Not (Me.Table1RowChangingEvent) Is Nothing) Then
RaiseEvent Table1RowChanging(Me, New Table1RowChangeEvent(CType(e.Row,Table1Row), e.Action))
End If
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Sub OnRowDeleted(ByVal e As System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleted(e)
If (Not (Me.Table1RowDeletedEvent) Is Nothing) Then
RaiseEvent Table1RowDeleted(Me, New Table1RowChangeEvent(CType(e.Row,Table1Row), e.Action))
End If
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected Overrides Sub OnRowDeleting(ByVal e As System.Data.DataRowChangeEventArgs)
MyBase.OnRowDeleting(e)
If (Not (Me.Table1RowDeletingEvent) Is Nothing) Then
RaiseEvent Table1RowDeleting(Me, New Table1RowChangeEvent(CType(e.Row,Table1Row), e.Action))
End If
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Sub RemoveTable1Row(ByVal row As Table1Row)
Me.Rows.Remove(row)
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
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 DataSet1 = New DataSet1
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 = "Table1DataTable"
type.Attributes.Add(attribute2)
type.Particle = sequence
Return type
End Function
End Class

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")> _
Partial Public Class Table1Row
Inherits System.Data.DataRow

Private tableTable1 As Table1DataTable

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Friend Sub New(ByVal rb As System.Data.DataRowBuilder)
MyBase.New(rb)
Me.tableTable1 = CType(Me.Table,Table1DataTable)
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Property ID() As Integer
Get
Return CType(Me(Me.tableTable1.IDColumn),Integer)
End Get
Set
Me(Me.tableTable1.IDColumn) = value
End Set
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Property Name() As String
Get
Try
Return CType(Me(Me.tableTable1.NameColumn),String)
Catch e As System.InvalidCastException
Throw New System.Data.StrongTypingException("The value for column 'Name' in table 'Table1' is DBNull.", e)
End Try
End Get
Set
Me(Me.tableTable1.NameColumn) = value
End Set
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Function IsNameNull() As Boolean
Return Me.IsNull(Me.tableTable1.NameColumn)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Sub SetNameNull()
Me(Me.tableTable1.NameColumn) = System.Convert.DBNull
End Sub
End Class

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0")> _
Public Class Table1RowChangeEvent
Inherits System.EventArgs

Private eventRow As Table1Row

Private eventAction As System.Data.DataRowAction

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public Sub New(ByVal row As Table1Row, ByVal action As System.Data.DataRowAction)
MyBase.New
Me.eventRow = row
Me.eventAction = action
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public ReadOnly Property Row() As Table1Row
Get
Return Me.eventRow
End Get
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Public ReadOnly Property Action() As System.Data.DataRowAction
Get
Return Me.eventAction
End Get
End Property
End Class
End Class

Namespace DataSet1TableAdapters

<System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.ComponentModel.ToolboxItem(true), _
System.ComponentModel.DataObjectAttribute(true), _
System.ComponentModel.DesignerAttribute("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner"& _
", Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Partial Public Class Table1TableAdapter
Inherits System.ComponentModel.Component

Private WithEvents _adapter As System.Data.OleDb.OleDbDataAdapter

Private _connection As System.Data.OleDb.OleDbConnection

Private _commandCollection() As System.Data.OleDb.OleDbCommand

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.OleDb.OleDbDataAdapter
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.OleDb.OleDbConnection
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.OleDb.OleDbCommand).Connection = value
End If
i = (i + 1)
Loop
End Set
End Property

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Protected ReadOnly Property CommandCollection() As System.Data.OleDb.OleDbCommand()
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.OleDb.OleDbDataAdapter
Dim tableMapping As System.Data.Common.DataTableMapping = New System.Data.Common.DataTableMapping
tableMapping.SourceTable = "Table"
tableMapping.DataSetTable = "Table1"
tableMapping.ColumnMappings.Add("ID", "ID")
tableMapping.ColumnMappings.Add("Name", "Name")
Me._adapter.TableMappings.Add(tableMapping)
Me._adapter.DeleteCommand = New System.Data.OleDb.OleDbCommand
Me._adapter.DeleteCommand.Connection = Me.Connection
Me._adapter.DeleteCommand.CommandText = "DELETE FROM `Table1` WHERE ((`ID` = ) AND (( = 1 AND `Name` IS NULL) OR (`Name`"& _
" = )))"
Me._adapter.DeleteCommand.CommandType = System.Data.CommandType.Text
Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.[Integer], 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", System.Data.DataRowVersion.Original, false, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Name", System.Data.OleDb.OleDbType.[Integer], 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Original, true, Nothing))
Me._adapter.DeleteCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Name", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Original, false, Nothing))
Me._adapter.InsertCommand = New System.Data.OleDb.OleDbCommand
Me._adapter.InsertCommand.Connection = Me.Connection
Me._adapter.InsertCommand.CommandText = "INSERT INTO `Table1` (`Name`) VALUES ( )"
Me._adapter.InsertCommand.CommandType = System.Data.CommandType.Text
Me._adapter.InsertCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Name", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Current, false, Nothing))
Me._adapter.UpdateCommand = New System.Data.OleDb.OleDbCommand
Me._adapter.UpdateCommand.Connection = Me.Connection
Me._adapter.UpdateCommand.CommandText = "UPDATE `Table1` SET `Name` = WHERE ((`ID` = ) AND (( = 1 AND `Name` IS NULL) "& _
"OR (`Name` = )))"
Me._adapter.UpdateCommand.CommandType = System.Data.CommandType.Text
Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Name", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Current, false, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_ID", System.Data.OleDb.OleDbType.[Integer], 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "ID", System.Data.DataRowVersion.Original, false, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("IsNull_Name", System.Data.OleDb.OleDbType.[Integer], 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Original, true, Nothing))
Me._adapter.UpdateCommand.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Name", System.Data.OleDb.OleDbType.VarWChar, 0, System.Data.ParameterDirection.Input, CType(0,Byte), CType(0,Byte), "Name", System.Data.DataRowVersion.Original, false, Nothing))
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitConnection()
Me._connection = New System.Data.OleDb.OleDbConnection
Me._connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings("newConnectionString").ConnectionString
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute()> _
Private Sub InitCommandCollection()
Me._commandCollection = New System.Data.OleDb.OleDbCommand(0) {}
Me._commandCollection(0) = New System.Data.OleDb.OleDbCommand
Me._commandCollection(0).Connection = Me.Connection
Me._commandCollection(0).CommandText = "SELECT ID, Name FROM Table1"
Me._commandCollection(0).CommandType = System.Data.CommandType.Text
End Sub

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Fill, true)> _
Public Overloads Overridable Function Fill(ByVal dataTable As DataSet1.Table1DataTable) 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.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.[Select], true)> _
Public Overloads Overridable Function GetData() As DataSet1.Table1DataTable
Me.Adapter.SelectCommand = Me.CommandCollection(0)
Dim dataTable As DataSet1.Table1DataTable = New DataSet1.Table1DataTable
Me.Adapter.Fill(dataTable)
Return dataTable
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataTable As DataSet1.Table1DataTable) As Integer
Return Me.Adapter.Update(dataTable)
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
Public Overloads Overridable Function Update(ByVal dataSet As DataSet1) As Integer
Return Me.Adapter.Update(dataSet, "Table1")
End Function

<System.Diagnostics.DebuggerNonUserCodeAttribute(), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
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(), _
System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")> _
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.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)> _
Public Overloads Overridable Function Delete(ByVal Original_ID As Integer, ByVal Original_Name As String) As Integer
Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_ID,Integer)
If (Original_Name Is Nothing) Then
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = System.DBNull.Value
Else
Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object)
Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_Name,String)
End If
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.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)> _
Public Overloads Overridable Function Insert(ByVal Name As String) As Integer
If (Name Is Nothing) Then
Me.Adapter.InsertCommand.Parameters(0).Value = System.DBNull.Value
Else
Me.Adapter.InsertCommand.Parameters(0).Value = CType(Name,String)
End If
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.Design.HelpKeywordAttribute("vs.data.TableAdapter"), _
System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)> _
Public Overloads Overridable Function Update(ByVal Name As String, ByVal Original_ID As Integer, ByVal Original_Name As String) As Integer
If (Name Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(0).Value = System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(0).Value = CType(Name,String)
End If
Me.Adapter.UpdateCommand.Parameters(1).Value = CType(Original_ID,Integer)
If (Original_Name Is Nothing) Then
Me.Adapter.UpdateCommand.Parameters(2).Value = CType(1,Object)
Me.Adapter.UpdateCommand.Parameters(3).Value = System.DBNull.Value
Else
Me.Adapter.UpdateCommand.Parameters(2).Value = CType(0,Object)
Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_Name,String)
End If
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
End Namespace

Regards







Re: Windows Forms Data Controls and Databinding Can't find the designer.vb file for my tableadapter

AndrasEliassen

Thank's, I'm aware of what the file looks like. It just doesn't exist in my project or the folder that I'm working in (as I stated originally)

thanks though....

Andras Eliassen