I did exactly what you suggested....no errors up to that point. The
error occurs when I then right-mouse clicked on Data Adapter and
tried creating DataSet. Here is the underlying Windows generated
code:
#Region " Windows Form Designer generated code
"
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form
Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents SqlDataAdapter1 As
System.Data.SqlClient.SqlDataAdapter
Friend WithEvents SqlSelectCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlInsertCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlUpdateCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlDeleteCommand1 As
System.Data.SqlClient.SqlCommand
Friend WithEvents SqlConnection1 As
System.Data.SqlClient.SqlConnection
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.SqlDataAdapter1 = New
System.Data.SqlClient.SqlDataAdapter()
Me.SqlSelectCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlInsertCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlUpdateCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlDeleteCommand1 = New System.Data.SqlClient.SqlCommand()
Me.SqlConnection1 = New System.Data.SqlClient.SqlConnection()
'
'SqlDataAdapter1
'
Me.SqlDataAdapter1.DeleteCommand = Me.SqlDeleteCommand1
Me.SqlDataAdapter1.InsertCommand = Me.SqlInsertCommand1
Me.SqlDataAdapter1.SelectCommand = Me.SqlSelectCommand1
Me.SqlDataAdapter1.TableMappings.AddRange(New
System.Data.Common.DataTableMapping() {New
System.Data.Common.DataTableMapping("Table", "School", New
System.Data.Common.DataColumnMapping() {New
System.Data.Common.DataColumnMapping("SchoolID", "SchoolID"), New
System.Data.Common.DataColumnMapping("School", "School")})})
Me.SqlDataAdapter1.UpdateCommand = Me.SqlUpdateCommand1
'
'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "SELECT SchoolID, School
FROM School"
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
'
'SqlInsertCommand1
'
Me.SqlInsertCommand1.CommandText = "INSERT INTO School(School)
VALUES (@School); SELECT SchoolID, School FROM School " & _
"WHERE (SchoolID = @@IDENTITY)"
Me.SqlInsertCommand1.Connection = Me.SqlConnection1
Me.SqlInsertCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@School",
System.Data.SqlDbType.VarChar, 50, "School"))
'
'SqlUpdateCommand1
'
Me.SqlUpdateCommand1.CommandText = "UPDATE School SET School =
@School WHERE (SchoolID = @Original_SchoolID) AND (Sch" & _
"ool = @Original_School); SELECT SchoolID, School FROM School
WHERE (SchoolID = @" & _
"SchoolID)"
Me.SqlUpdateCommand1.Connection = Me.SqlConnection1
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@School",
System.Data.SqlDbType.VarChar, 50, "School"))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_SchoolID",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "SchoolID",
System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_School",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "School", System.Data.DataRowVersion.Original, Nothing))
Me.SqlUpdateCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@SchoolID",
System.Data.SqlDbType.Int, 4, "SchoolID"))
'
'SqlDeleteCommand1
'
Me.SqlDeleteCommand1.CommandText = "DELETE FROM School WHERE
(SchoolID = @Original_SchoolID) AND (School = @Original_" & _
"School)"
Me.SqlDeleteCommand1.Connection = Me.SqlConnection1
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_SchoolID",
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "SchoolID",
System.Data.DataRowVersion.Original, Nothing))
Me.SqlDeleteCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@Original_School",
System.Data.SqlDbType.VarChar, 50,
System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0,
Byte), "School", System.Data.DataRowVersion.Original, Nothing))
'
'SqlConnection1
'
Me.SqlConnection1.ConnectionString = "data
source=DANGELO\VSdotNET;initial catalog=YorkvilleDB;integrated
security=SSPI" & _
";persist security info=False;workstation id=DANGELO;packet
size=4096"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(432, 398)
Me.Name = "Form1"
Me.Text = "Form1"
End Sub
#End Region