I have a winform that is connected to 2 databases. One database is to display data in a combobox and the other is to save the data form the winform application. I created a parkingClass.cs, then double clicked the add button to write the script. When I type contactClass c = new contactClass(); I get an error (last line of code below). I hover over the error to get recomendations to correct the error but "using ParkingForm.parkingClasses;" does not appear in the list of option to correct the issue. How do I resolve the error?
- 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 Parking
- {
- public partial class ParkingForm : Form
- {
- SqlConnection con = new SqlConnection("Data Source=CAD;Initial Catalog=Reporting_System;Persist Security Info=True;User ID=sa;Password=***********");
- public ParkingForm()
- {
- InitializeComponent();
- }
- private void ParkingForm_Load(object sender, EventArgs e)
- {
- try
- {
- con.Open();
- SqlCommand sc = new SqlCommand("select Emp_Name from Personnel where JurisdictionID = 99 order by Emp_Name asc", con);
- SqlDataReader reader;
- reader = sc.ExecuteReader();
- DataTable dt = new DataTable();
- dt.Columns.Add("Emp_Name", typeof(String));
- dt.Load(reader);
- Dispatcher.ValueMember = "Emp_Name";
- Dispatcher.DataSource = dt;
- con.Close();
- }
- catch (Exception)
- {
- }
- }
- private void label6_Click(object sender, EventArgs e)
- {
- }
- private void Savebtn_Click(object sender, EventArgs e)
- {
- contactClass c = new contactClass();
- }
- }
- }