WFA_psychometric_chart.Form1_main.DeleteNodeUsingNodeID C# (CSharp) Method

DeleteNodeUsingNodeID() public method

public DeleteNodeUsingNodeID ( string nodeID ) : void
nodeID string
return void
        public void DeleteNodeUsingNodeID(string nodeID)
        {
            string tableName = "tbl_" + selectedBuildingList[0].BuildingName + "_node_value";// "tbl_" ++"_node_value";
            string databasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string databaseFile = databasePath + @"\db_psychrometric_project.s3db";
            string connString = @"Data Source=" + databaseFile + ";Version=3;";

            using (SQLiteConnection connection = new SQLiteConnection(connString))
            {
                connection.Open();
                SQLiteDataReader reader = null;
                string queryString = "delete   from  " + tableName + "  where nodeID = @id_value";
                SQLiteCommand command = new SQLiteCommand(queryString, connection);
                command.Parameters.AddWithValue("@id_value", nodeID);
                //SqlDataAdapter dataAdapter = new SqlDataAdapter(queryString, connection.ConnectionString); //connection.ConnectionString is the connection string
                reader = command.ExecuteReader();


            }//Close of using 

            //==This one is for deleting mix node info if present 
            string tableMixNodeInfo = "tbl_" + selectedBuildingList[0].BuildingName + "_mix_node_info";// "tbl_" ++"_node_value";
            using (SQLiteConnection connection = new SQLiteConnection(connString))
            {
                connection.Open();
                SQLiteDataReader reader = null;
                string queryString = "delete   from  " + tableMixNodeInfo + "  where nodeID = @id_value";
                SQLiteCommand command = new SQLiteCommand(queryString, connection);
                command.Parameters.AddWithValue("@id_value", nodeID);
                //SqlDataAdapter dataAdapter = new SqlDataAdapter(queryString, connection.ConnectionString); //connection.ConnectionString is the connection string
                reader = command.ExecuteReader();
                   
            }//Close of using 


        }
Form1_main