Question
Advanced C# Finish this code using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient;
Advanced C#
Finish this code
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Data.SqlClient;
namespace Practice_Lab_3_for_Chapter_5 { public partial class frmViewVendors : Form { public frmViewVendors() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { // TODO: This line of code loads data into the 'payablesDataSet.States' table. You can move, or remove it, as needed. try { this.statesTableAdapter.Fill(this.payablesDataSet.States); } catch { MessageBox.Show("Database problem with Payables database!", "User Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
}
private void statesDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 50 ) //check if a button was clicked in grid { DataGridViewRow row = statesDataGridView.Rows[e.RowIndex]; //get row that was clicked by user DataGridViewCell cell = row.Cells[0]; //get state code that was selected
string StateCode = cell.Value.ToString();
ViewVendorsInState frmStateVendors = new ;
frmStateVendors.Text = StateCode;
?.ShowDialog();
} } } }
Cis 232 Practice Lab Problem #3-Chapter 5 Student: 7T 12 Total points 1. Copy/Open the Practice Lab 3 for Chapter 5 project. 2. View the Vendor States Form in the Designer window 3. Add a button to the DataGridView control with the following property settings: a. Name btnViewStateVendors. b. Text- View State Vendors. c. UseColumnTextForButtonValue True. 4. View the PayablesDataSet schema file within the Designer window. a. Configure the StatesTableAdapter Fill method to sort the states by StateName. b. When you run the application the form should look like the following: View Vendors in States iew State Vendors View State Vendors iew State Vendors ew State Vendors Vew State Vendors Colorado View State Vendors Vew State Vendors Delaware ew State Vendos District of Columbia View State Vendors Vendor States labama Alaska Arizona Arkansas Califomia 5. Uncomment the statesDataGridview_Cellcontentclick even procedure. Finish coding event procedure by replacing "?" with correct C# code. 6. View the PayablesDataset schema file in the Designer window. Add the following query to the VendorsTableAdapter and name it FillByState: SELECT Name, Address1, Address2, City, State, ZipCode FROM dbo.Vendors Where State - @State 7. Display ViewVendorsinState form in the Designer window. Uncomment the ViewVendorsInstate Load event method. Finish coding the event procedure by replacing the "?" character a. b. Cis 232 Practice Lab Problem #3-Chapter 5 Student: 7T 12 Total points 1. Copy/Open the Practice Lab 3 for Chapter 5 project. 2. View the Vendor States Form in the Designer window 3. Add a button to the DataGridView control with the following property settings: a. Name btnViewStateVendors. b. Text- View State Vendors. c. UseColumnTextForButtonValue True. 4. View the PayablesDataSet schema file within the Designer window. a. Configure the StatesTableAdapter Fill method to sort the states by StateName. b. When you run the application the form should look like the following: View Vendors in States iew State Vendors View State Vendors iew State Vendors ew State Vendors Vew State Vendors Colorado View State Vendors Vew State Vendors Delaware ew State Vendos District of Columbia View State Vendors Vendor States labama Alaska Arizona Arkansas Califomia 5. Uncomment the statesDataGridview_Cellcontentclick even procedure. Finish coding event procedure by replacing "?" with correct C# code. 6. View the PayablesDataset schema file in the Designer window. Add the following query to the VendorsTableAdapter and name it FillByState: SELECT Name, Address1, Address2, City, State, ZipCode FROM dbo.Vendors Where State - @State 7. Display ViewVendorsinState form in the Designer window. Uncomment the ViewVendorsInstate Load event method. Finish coding the event procedure by replacing the "?" character a. bStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started