/// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.specConnection    = new System.Data.SqlClient.SqlConnection();
     this.specAdapter       = new System.Data.SqlClient.SqlDataAdapter();
     this.spyDS             = new SpyMaster.spies();
     this.specDG            = new System.Windows.Forms.DataGrid();
     this.button1           = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.spyDS)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.specDG)).BeginInit();
     this.SuspendLayout();
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT SpecialtyID, Specialtyname FROM Specialties";
     this.sqlSelectCommand1.Connection  = this.specConnection;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO Specialties(SpecialtyID, Specialtyname) VALUES (@SpecialtyID, @Specia" +
                                          "ltyname); SELECT SpecialtyID, Specialtyname FROM Specialties WHERE (SpecialtyID " +
                                          "= @SpecialtyID)";
     this.sqlInsertCommand1.Connection = this.specConnection;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SpecialtyID", System.Data.SqlDbType.Int, 4, "SpecialtyID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Specialtyname", System.Data.SqlDbType.VarChar, 20, "Specialtyname"));
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE Specialties SET SpecialtyID = @SpecialtyID, Specialtyname = @Specialtyname WHERE (SpecialtyID = @Original_SpecialtyID) AND (Specialtyname = @Original_Specialtyname); SELECT SpecialtyID, Specialtyname FROM Specialties WHERE (SpecialtyID = @SpecialtyID)";
     this.sqlUpdateCommand1.Connection  = this.specConnection;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@SpecialtyID", System.Data.SqlDbType.Int, 4, "SpecialtyID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Specialtyname", System.Data.SqlDbType.VarChar, 20, "Specialtyname"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SpecialtyID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SpecialtyID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Specialtyname", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Specialtyname", System.Data.DataRowVersion.Original, null));
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = "DELETE FROM Specialties WHERE (SpecialtyID = @Original_SpecialtyID) AND (Specialt" +
                                          "yname = @Original_Specialtyname)";
     this.sqlDeleteCommand1.Connection = this.specConnection;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_SpecialtyID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "SpecialtyID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Specialtyname", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Specialtyname", System.Data.DataRowVersion.Original, null));
     //
     // specConnection
     //
     this.specConnection.ConnectionString = "data source=ANDY-MPECR6VC86\\VSTE;initial catalog=spy;integrated security=SSPI;per" +
                                            "sist security info=True;workstation id=ANDY-MPECR6VC86;packet size=4096";
     //
     // specAdapter
     //
     this.specAdapter.DeleteCommand = this.sqlDeleteCommand1;
     this.specAdapter.InsertCommand = this.sqlInsertCommand1;
     this.specAdapter.SelectCommand = this.sqlSelectCommand1;
     this.specAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Specialties", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("SpecialtyID", "SpecialtyID"),
             new System.Data.Common.DataColumnMapping("Specialtyname", "Specialtyname")
         })
     });
     this.specAdapter.UpdateCommand = this.sqlUpdateCommand1;
     //
     // spyDS
     //
     this.spyDS.DataSetName = "spies";
     this.spyDS.Locale      = new System.Globalization.CultureInfo("en-US");
     this.spyDS.Namespace   = "http://www.tempuri.org/spies.xsd";
     //
     // specDG
     //
     this.specDG.DataMember      = "Specialties";
     this.specDG.DataSource      = this.spyDS;
     this.specDG.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.specDG.Location        = new System.Drawing.Point(16, 24);
     this.specDG.Name            = "specDG";
     this.specDG.Size            = new System.Drawing.Size(336, 216);
     this.specDG.TabIndex        = 0;
     //
     // button1
     //
     this.button1.Location = new System.Drawing.Point(112, 264);
     this.button1.Name     = "button1";
     this.button1.Size     = new System.Drawing.Size(136, 24);
     this.button1.TabIndex = 1;
     this.button1.Text     = "update";
     this.button1.Click   += new System.EventHandler(this.button1_Click);
     //
     // EditSpecialties
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(376, 317);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this.button1,
         this.specDG
     });
     this.Name  = "EditSpecialties";
     this.Text  = "EditSpecialties";
     this.Load += new System.EventHandler(this.EditSpecialties_Load);
     ((System.ComponentModel.ISupportInitialize)(this.spyDS)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.specDG)).EndInit();
     this.ResumeLayout(false);
 }
示例#2
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
     this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
     this.AssignConnection  = new System.Data.SqlClient.SqlConnection();
     this.AssignAdapter     = new System.Data.SqlClient.SqlDataAdapter();
     this.spyDS             = new SpyMaster.spies();
     this.assignDG          = new System.Windows.Forms.DataGrid();
     this.btnUpdate         = new System.Windows.Forms.Button();
     ((System.ComponentModel.ISupportInitialize)(this.spyDS)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.assignDG)).BeginInit();
     this.SuspendLayout();
     //
     // sqlSelectCommand1
     //
     this.sqlSelectCommand1.CommandText = "SELECT * FROM Assignments";
     this.sqlSelectCommand1.Connection  = this.AssignConnection;
     //
     // sqlInsertCommand1
     //
     this.sqlInsertCommand1.CommandText = "INSERT INTO Assignments(AssignmentID, Name, Description, Location) VALUES (@Assig" +
                                          "nmentID, @Name, @Description, @Location); SELECT AssignmentID, Name, Description" +
                                          ", Location FROM Assignments WHERE (AssignmentID = @AssignmentID)";
     this.sqlInsertCommand1.Connection = this.AssignConnection;
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AssignmentID", System.Data.SqlDbType.Int, 4, "AssignmentID"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 20, "Name"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Description", System.Data.SqlDbType.VarChar, 50, "Description"));
     this.sqlInsertCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Location", System.Data.SqlDbType.VarChar, 20, "Location"));
     //
     // sqlUpdateCommand1
     //
     this.sqlUpdateCommand1.CommandText = @"UPDATE Assignments SET AssignmentID = @AssignmentID, Name = @Name, Description = @Description, Location = @Location WHERE (AssignmentID = @Original_AssignmentID) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (Location = @Original_Location OR @Original_Location IS NULL AND Location IS NULL) AND (Name = @Original_Name OR @Original_Name IS NULL AND Name IS NULL); SELECT AssignmentID, Name, Description, Location FROM Assignments WHERE (AssignmentID = @AssignmentID)";
     this.sqlUpdateCommand1.Connection  = this.AssignConnection;
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@AssignmentID", System.Data.SqlDbType.Int, 4, "AssignmentID"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Name", System.Data.SqlDbType.VarChar, 20, "Name"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Description", System.Data.SqlDbType.VarChar, 50, "Description"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Location", System.Data.SqlDbType.VarChar, 20, "Location"));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AssignmentID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AssignmentID", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Description", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Description", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Location", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Location", System.Data.DataRowVersion.Original, null));
     this.sqlUpdateCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Name", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Name", System.Data.DataRowVersion.Original, null));
     //
     // sqlDeleteCommand1
     //
     this.sqlDeleteCommand1.CommandText = @"DELETE FROM Assignments WHERE (AssignmentID = @Original_AssignmentID) AND (Description = @Original_Description OR @Original_Description IS NULL AND Description IS NULL) AND (Location = @Original_Location OR @Original_Location IS NULL AND Location IS NULL) AND (Name = @Original_Name OR @Original_Name IS NULL AND Name IS NULL)";
     this.sqlDeleteCommand1.Connection  = this.AssignConnection;
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_AssignmentID", System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "AssignmentID", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Description", System.Data.SqlDbType.VarChar, 50, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Description", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Location", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Location", System.Data.DataRowVersion.Original, null));
     this.sqlDeleteCommand1.Parameters.Add(new System.Data.SqlClient.SqlParameter("@Original_Name", System.Data.SqlDbType.VarChar, 20, System.Data.ParameterDirection.Input, false, ((System.Byte)(0)), ((System.Byte)(0)), "Name", System.Data.DataRowVersion.Original, null));
     //
     // AssignConnection
     //
     this.AssignConnection.ConnectionString = "data source=ANDY-MPECR6VC86\\VSTE;initial catalog=spy;integrated security=SSPI;per" +
                                              "sist security info=True;workstation id=ANDY-MPECR6VC86;packet size=4096";
     //
     // AssignAdapter
     //
     this.AssignAdapter.DeleteCommand = this.sqlDeleteCommand1;
     this.AssignAdapter.InsertCommand = this.sqlInsertCommand1;
     this.AssignAdapter.SelectCommand = this.sqlSelectCommand1;
     this.AssignAdapter.TableMappings.AddRange(new System.Data.Common.DataTableMapping[] {
         new System.Data.Common.DataTableMapping("Table", "Assignments", new System.Data.Common.DataColumnMapping[] {
             new System.Data.Common.DataColumnMapping("AssignmentID", "AssignmentID"),
             new System.Data.Common.DataColumnMapping("Name", "Name"),
             new System.Data.Common.DataColumnMapping("Description", "Description"),
             new System.Data.Common.DataColumnMapping("Location", "Location")
         })
     });
     this.AssignAdapter.UpdateCommand = this.sqlUpdateCommand1;
     //
     // spyDS
     //
     this.spyDS.DataSetName = "spies";
     this.spyDS.Locale      = new System.Globalization.CultureInfo("en-US");
     this.spyDS.Namespace   = "http://www.tempuri.org/spies.xsd";
     //
     // assignDG
     //
     this.assignDG.DataMember      = "Assignments";
     this.assignDG.DataSource      = this.spyDS;
     this.assignDG.HeaderForeColor = System.Drawing.SystemColors.ControlText;
     this.assignDG.Location        = new System.Drawing.Point(48, 24);
     this.assignDG.Name            = "assignDG";
     this.assignDG.Size            = new System.Drawing.Size(352, 200);
     this.assignDG.TabIndex        = 0;
     //
     // btnUpdate
     //
     this.btnUpdate.Location = new System.Drawing.Point(144, 240);
     this.btnUpdate.Name     = "btnUpdate";
     this.btnUpdate.Size     = new System.Drawing.Size(152, 24);
     this.btnUpdate.TabIndex = 1;
     this.btnUpdate.Text     = "update";
     this.btnUpdate.Click   += new System.EventHandler(this.btnUpdate_Click);
     //
     // EditAssignment
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(432, 273);
     this.Controls.AddRange(new System.Windows.Forms.Control[] {
         this.btnUpdate,
         this.assignDG
     });
     this.Name  = "EditAssignment";
     this.Text  = "EditAssignment";
     this.Load += new System.EventHandler(this.EditAssignment_Load);
     ((System.ComponentModel.ISupportInitialize)(this.spyDS)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.assignDG)).EndInit();
     this.ResumeLayout(false);
 }