TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Walter Graulich
NA
2
600
contactClass error on Add button
Jun 25 2020 1:03 PM
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();
}
}
}
Reply
Answers (
2
)
help to create a validation user with c# and mysql
Two way Databinding with entityframework 6