Q: i cant insert data in database through classes .that show error "invalid column name" hello i have some issue in code
i save the data from class to database by using button but i have continuously i have error "invalid column name" please resolve my problem. 
that id connection class;
using System;
using System.Windows.Forms;
using System.Data.SqlClient;
using project_airline_oop.user.staft.new_member;
using project_airline_oop.user.schedules_flights;

namespace project_airline_oop.dbconnection
{
    public static class dbconnection
    {
        private static bool connection;
        private static string _query;

        public static readonly string ConnectionString = "Data Source=LUKAAA\\SQLSERVER1;Initial Catalog=airline;Integrated Security=True;Connect Timeout=15;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False";
        public static SqlConnection GetConnection()
        {
            SqlConnection conn = null;
            try
            {
                conn = new SqlConnection(ConnectionString);
                return conn;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

            return conn;
        }


     public static bool insertlocalflight(local_scheduleflight ab)
        {
            connection = false;
            using (var con = GetConnection())
            {
                try
                {
                    con.Open();
                    _query = "insert into local_fligth_timinig (" +
                        "time_flightlocal," +
                        "local_destination," +
                        "flight_date," +
                        "local_flightname," +
                        "flight_no)" +
                        "values(" +
                        "@time_local," +
                        "@city_local," +
                        "@date_flight," +
                        "@local_airline," +
                        "@flight_number)";
                    var cmd = new SqlCommand(_query, con);
                    cmd.Parameters.AddWithValue("@time_local", ab.time_flightlocal);
                    cmd.Parameters.AddWithValue("@city_local", ab.local_destination);
                    cmd.Parameters.AddWithValue("@date_flight", ab.flight_date);
                    cmd.Parameters.AddWithValue("@local_airline", ab.local_flightname);
                    cmd.Parameters.AddWithValue("@flight_number",ab.flight_no);
                    cmd.ExecuteNonQuery();
                    connection = true;
                }
                catch(Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
                   finally
                {
                    con.Close();
                }
                }
            return connection;
            }



        }

    }

that is my class
  namespace project_airline_oop.user.schedules_flights
{
   public class local_scheduleflight
    {
        public DateTime time_flightlocal { get; set; }
        public string local_destination { get; set; }
        public DateTime flight_date { get; set; }
        public string local_flightname { get; set; }
        public int flight_no { get; set; }

    }
}

and that is save button method
private void save_flightloacal1_Click(object sender, EventArgs e)
    {
        var localflight = new user.schedules_flights.local_scheduleflight
        {
            time_flightlocal = flight_time1lo.Value,
            local_destination = local_airport.DisplayMember,
            flight_date = Date_flight.Value,
            local_flightname = local_airport.DisplayMember,
            flight_no = int.Parse(flight_nolocal.Text),

        };
        if (dbconnection.dbconnection.insertlocalflight(localflight))
        {
            MessageBox.Show("insert first 1 slot");
        }
        else``
        {
            MessageBox.Show("error");
        }
    }

enter image description here
that is table
column name       datatype
time_local        time(7)
city_local        varchar(50) 
date_flight       date
local_airline     varchar(50)
flight_number     int


A: The field names in your insert statement
_query = "insert into local_fligth_timinig (" +
                    "time_flightlocal," +
                    "local_destination," +
                    "flight_date," +
                    "local_flightname," +
                    "flight_no)" +

don't match up to the field names in your table
column name       datatype
time_local        time(7)
city_local        varchar(50) 
date_flight       date
local_airline     varchar(50)
flight_number     int

Change it to
_query = "insert into local_fligth_timinig (" +
                    "time_local," +
                    "city_local," +
                    "date_flight," +
                    "local_airline," +
                    "flight_number)" +

Also looks like a typo in the table name, but this maybe how you have spelt it in the database.
